require 'jdbc_adapter' (NOT require 'active_record/connection_adapters/jdbc_adapter' as Rails-Integration's Wiki said!)
just blow line
require File.join(File.dirname(__FILE__), 'boot')
6. Set and export $JRUBY_HOME, this will be used by GoldSpike plugin when generating WAR file.
Actuall, you can put all jar files used by GoldSpike under $JRUBY_HOME/lib to avoid downloading them when you generating the war file with rake, it's really annoying when you have to wait for the download complete.These jar files are (the version I use):
- activation-x.x.jar (1.1)
- bcprov-jdk14-xxx.jar (124)
- commons-pool-x.x.x.jar (1.3)
- jruby-complete-x.x.x.jar (0.9.9)
- rail-integration-x.x.x.jar (1.1.1)
- jetty-x.x.x.jar (6.1.1)
7. Put <your-db-jdbc-driver>.jar</your-db-jdbc-driver> (e.g., mysql-connector-java-5.0.5-bin.jar for MySQL) under $JRUBY_HOME/lib. 8. Generate standalone war file by executing
rake war:standalone:create
9. Test the war file by executing
rake war:standalone:run
This use jetty. Of coure, you can deploy it to your Tomcat.KNOWN ISSUES
On Tomcat, when we tried to start up the second Rails application, we got OutOfMemoryException, and we don't know whether this has something to do with the way we connect to the database.