(NOTE: JRubyWorks keeps moving forward and this article may not be up to date.)
How to run your Rails application with J2EE web servers (such as Jetty and Tomcat )? Here’s a solution:
1. Set JRUBY _HOME environment variable properly.
export JRUBY_HOME=/usr/lib/jruby
2. Install ActiveRecord-JDBC .
jruby -S gem install ActiveRecord-JDBC -y
3. Install JRubyWorks plugin.
script/plugin install \ http://jrubyworks.rubyforge.org/svn/trunk/jrubyworks/
4. Configure your Rails application as this article . JRubyWorks plugin includes mysql-connector by default. If you use database other than MySQL , you can put corresponding JDBC driver in ${RAILS_ROOT}/lib/java directory and JRubyWorks will take care of it conventionally.
5. Run your application and try it at http://localhost:8080 . Also you can find a WAR file of your application in ${RAILS_ROOT}/war directory. You can deploy it to other J2EE web servers.
jruby -S rake retty
JRubyWorks is based on JRuby Rails Integration and hope to make the integration easier. It’s quite immature so far, apparently. Your feedback and contribution will be very helpful and highly appreciated.