Download@
export JRUBY_HOME=/home/jruby/jruby-1.0
export JRE_HOME=/home/java_1.5.0_06
export JAVA_HOME=/home/java_1.5.0_06
#no slash at the end :)
export PATH=/home/jruby/jruby-1.0/bin:/home/jruby/bin:$JAVA_HOME/bin:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/jruby/jruby-1.0/lib:$JAVA_HOME/lib
Notice, I did not set CLASSPATH since jruby would grab everything in jruby/lib directory and set it to CLASSPATH
Download oracle jdbc driver
and copy it to jruby/lib folder (if you don’t want to bother with CLASSPATH settings.
Everywhere in your ruby script you will need to change env pointer to
#!/usr/bin/env jruby
config/environment.rb
if RUBY_PLATFORM =~ /java/
require 'rubygems'
gem 'ActiveRecord-JDBC'
require 'jdbc_adapter'
end
development:
adapter: jdbc
driver: oracle.jdbc.driver.OracleDriver
url: jdbc:oracle:thin:@hostname:port:interfacename
username: ...
password: ...
Everything else is the same for your app.
Outside links that were helpful and more useful then this one.
JRuby Home JRuby Wiki Article About JrubyOnRails on Jruby Wiki JRuby Repository