cd /Library/JavaDev/ curl http://jruby.kenai.com/downloads/1.4.0/jruby-bin-1.4.0.tar.gz > jruby-bin-1.4.0.tar.gz tar xzvf jruby-bin-1.4.0.tar.gz
make sure your user has permissions to execute files in the bin directory. As a matter of good house keeping, I also like to setup a symlinkln -s jruby-1.4.0 jruby
next lets see where ruby is currently running from typewhich gem
It most likely is running under /usr/bin/gem. We want to change that temporarily so we can update the gem system. Lets change our path and update the gem systemexport JRUBY_HOME=/Library/JavaDev/jruby export PATH=$JRUBY_HOME/bin:$PATH which gem
the last command should now read /Library/JavaDev/jruby/bin/gem. If at any point you now close your terminal window you’ll need to run the last three commands again to make sure you’re working with the right gem base. Time to update the gems on your system: gem install rails gem update system gem install activerecord-jdbcsqlite3-adapter gem install jdbc-sqlite3 gem install activerecord-jdbcmysql-adapter You will probably see a message “JRuby limited openssl loaded. gem install jruby-openssl for full support.” As long as this is just a development station don’t worry about it. Now on to IDEA. Open the dmg and copy IDEA to your application folder. Run the app and create a new Ruby project. Once you get to the point that you need a project SDK click configure and add. The file IDEA is looking for is $JRUBY_HOME/bin/jruby. It will detect the lib folders from there. Last step make sure you’re using the appropriate sql adapter in your database.yml file. For sqlite your dev should look something like:development: adapter: jdbcsqlite3 database: db/development.sqlite3 pool: 5 timeout: 5000
Notice the adapter is jdbcsqlite3 rather than the standard sqlite3 That’s it. If you want to use a db other than sqllite, you’ll need to install the appropriate gem. IDEA will warn you & let you fix it if you forget to do this so no big deal. For reference:- OSX 10.6.2
- Jruby 1.4.0
- Rails 2.3.5
- Idea Ultimate 9.0.1