Thursday May 17, 2007
Database-enabled RoR WAR on GlassFish
UPDATE: Simplified steps for GlassFish V2 are available here and for V3 here.
Follow up from here.In this post I'll show how a Ruby-on-Rails (RoR) application, talking to MySQL database, can be deployed as a WAR file on GlassFish V2. Here are the steps I followed:
Configuration' and open 'database.yml'.
Change production database entry from:production:
adapter: mysql
database: HelloWorld_production
username: root
password:
host: localhost
production:
adapter: jdbc
driver: com.mysql.jdbc.Driver
url: jdbc:mysql://localhost:3306/helloworld_development
username: root
password:Configuration', 'environment.rb', addrequire 'jdbc_adapter'Rails::Initializer.run do |config|if RUBY_PLATFORM =~ /java/
require 'rubygems'
RAILS_CONNECTION_ADAPTERS = %w(jdbc)
end
rake war:standalone:create' from your application directory.
domains/domain1/autodeploy"
directory of your GlassFish instance and you are done!With this, you've deployed a Ruby-on-Rails application accessing MySQL database as a WAR file on GlassFish V2.
Technorati: glassfish rubyonrails ror netbeans jruby ruby
Posted by Arun Gupta in web2.0 | Comments[7]
|
|
|
|
Today's Page Hits: 8444
Posted by Arun Gupta's Blog on May 17, 2007 at 01:56 PM PDT #
Posted by Arun Gupta's Blog on May 20, 2007 at 09:17 AM PDT #
Posted by Arun Gupta's Blog on July 23, 2007 at 11:21 AM PDT #
Posted by Arun Gupta's Blog on August 07, 2007 at 09:59 AM PDT #
Posted by Arun Gupta's Blog on August 08, 2007 at 09:46 AM PDT #
Posted by Arun Gupta's Blog on August 09, 2007 at 11:20 AM PDT #
Posted by Arun Gupta's Blog on August 27, 2007 at 10:35 AM PDT #