Deploy and Run Rails on GlassFish v3GlassFish gem offers robust and easy to deploy and run Rails applications. Although sometimes you would need to use JavaEE features from inside your Rails application and for this you would need to GlassFish v3 server. Install GlassFish v3Follow the directions on how to install GlassFish v3 here Start GlassFish v3Once GlassFish v3 is installed, do the following to start GlassFish v3 server. Start GlassFish using asadmin command
asadmin start-domain Above /tools/jruby-1.3.1 should be replaced by the path to the JRuby install. Note: If you have installed the GlassFish v3 JRuby IPS package using updatetool then there is no need to set jruby.home system property. Deploy Rails application
asadmin deploy hello/ If you like to use JRuby installation other than the one from UpdateTool or the one you setup using configure-jruby-container --jruby-home=... command then deploy using following command: asadmin deploy --property jruby.home=/tools/jruby-1.4.0 hello/ The application is deployed at *http://localhost:8080/hello/* and ready to accept requests. Hitting *http://localhost:8080/hello/say/hello* will print "Hello World!" in the browser. Un-deploy Rails application
$GLASSFISH_HOME/bin/asadmin undeploy hello Note: You can combine multiple deployment properties using ':' separator. For example, asadmin deploy --property jruby.rackEnv=production:jruby.home=/tools/jruby-1.4.0 |
asadmin configure-jruby-container --jruby.home=/tools/jruby-1.3.1
export RAILS_ENV=production
asadmin deploy --property jruby.rackEnv=production