Database-enabled RoR WAR on GlassFish
Follow up from
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:
- Create a HelloWorld RoR app talking to MySQL database as described
- Expand NetBeans project, expand '
Configuration' and open '
Change production database entry from:
Notice, even though this is production setting we are using a "development"
- In '
Rails::Initializer.run do |config|
On some platforms, this syntax has caused problems. In that case, it may
alternatively be specified (step
if RUBY_PLATFORM =~ /java/
RAILS_CONNECTION_ADAPTERS = %w(jdbc)
- Recreate the WAR file by invoking the command '
rake war:standalone:create' from your application directory.
- Drop this WAR file in "
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.