ActiveRecord-JDBC 0.6 Released: Much Easier to Run Rails in JRuby

by Tim O'Brien

Nick Sieger announces the availability of a new release of ActiveRecord-JDBC on his blog in ActiveRecord-JDBC 0.6 Released! You might just let this piece of news go by unnoticed, but if you read Nick's blog entry, you'll see that it is a turning point for people who want to get a Rails application running under JRuby, Nick writes (emphasis mine):


..to make your application run under JRuby, no longer will you need to a) find and download appropriate JDBC drivers, b) wonder where they should be placed so that JRuby will find them, or c) make custom changes to config/environment.rb. All that’s taken care of you if you use one of the following adapters:

* activerecord-jdbcmysql-adapter (MySQL)
* activerecord-jdbcpostgresql-adapter (PostgreSQL)
* activerecord-jdbcderby-adapter (Derby)
* activerecord-jdbchsqldb-adapter (HSQLDB)


One thing that's great about RoR is the convenience of it all. I spend about half of my time dealing with J2EE and a quarter with RoR, and the amount of setup that is involved in the J2EE world defies belief. Nick has made a point to emphasize the ease with which you can dive into the JDBC-backed ActiveRecord:


We can leverage this convention to make it easier than ever to get started using JRuby with your Rails application. So, the first thing new in the 0.6 release is the name. You now install activerecord-jdbc-adapter:

jruby -s gem install activerecord-jdbc-adapter

But wait, there’s more! We also have adapters for four open-source databases, including MySQL, PostgreSQL, and two embedded Java databases, Derby and HSQLDB. And, for your convenience, we’ve bundled the JDBC drivers in dependent gems, so you don’t have to go hunting them down if you don’t have them handy.

...

$ jruby -S gem install activerecord-jdbcderby-adapter --include-dependencies
Successfully installed activerecord-jdbcderby-adapter-0.6
Successfully installed activerecord-jdbc-adapter-0.6
Successfully installed jdbc-derby-10.2.2.0