Upgrading to JRuby 1.7.0 – Not So Easy…

JRuby

This morning I wanted to again try to get JRuby 1.7.0 installed and working for our project at The Shop. It's not that it wasn't working - in fact, I figured out that it was all in the handling of '/../' by Dir.glob() in JRuby - but we have a way around that, so we're good to go. No… this was meant to wait until 1.7.0 final was out, and then move to it as a group.

The test repo I've been working with is pretty simple, but it has all the components I need. It's got an .rvmrc that points to the right version of JRuby:

  export JRUBY_OPTS="-Ilib --1.9"
  rvm use jruby-1.7.0@jar-test --create

and so I should be able to simply install JRuby and use it:

  $ rvm install jruby-1.7.0

but when I do that, I got all kinds of problems. Problems with bundler, problems even with rvm. So I go to the jruby channel on IRC and ask what's up? I get the answer:

  $ rvm get head

Seems the latest stable rvm can't handle the install. I had to get the very latest version to make it work. Yikes!

After that, you might be tempted to install jruby-1.7.0, but don't! There's one more thing that's a known issue with Mac OS X and rvm - the CodeSign with OS X. Currently, it's not working, so you have to:

  $ chmod -x $rvm_path/hooks/after_install_codesign

to make it not executable. This will then leave you with something that will work when you install jruby-1.7.0:

  $ rvm install jruby-1.7.0

Still, when I did that, I was able to then use it:

  $ cd jar-test
  Using /Users/bbeaty/.rvm/gems/jruby-1.7.0 with gem set jar-test
  $ bundle install

and everything gets up to date.

Very cool - but had I not messed around with this for an hour, I would have been a lot happier.