Tuesday, June 8, 2010



If you're trying to use jruby on rails, and you see an error like this:
GEM_HOME=~/.jrubygem jruby -S rake db:create:all
(in /private/tmp/fnord)
!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.
rake aborted!
no such file to load -- mysql

(See full trace by running task with --trace)


The solution is to run script/generate jdbc:

GEM_HOME=~/.jrubygem jruby -S script/generate jdbc
      exists  config/initializers
      create  config/initializers/jdbc.rb
      exists  lib/tasks
      create  lib/tasks/jdbc.rake
See Nick Sieger's blog for more detail.

No comments: