Quick Tip: Installing JRuby with RVM
As I mentioned I installed JRuby to test the performance differences of my minimax algorithm using JRuby vs MRI. Although JRuby would run I kept getting “TypeError: Can’t Convert Hash to String” errors from various config files during the install.
On the JRuby.org page their instructions for installing with RVM are just:
If you use RVM, then installing JRuby is also a piece of cake:
rvm install jruby
Well, yeah, not so much cake for me. Fortunately I came across these instructions over on the JRuby wiki:
Note: If you're using RVM to install JRuby, remove these options from (your optional
rubygems configuration file) ~/.gemrc: --conservative --local.
With `--local', (at this writing) RVM fails to obtain the jruby-launcher gem required by jruby.
With `--conservative', the older rubygems (at this writing, 1.8.9) currently used by JRuby fails
to begin gem executables with #!/usr/bin/env, and that doesn't work on most systems.
Then: rvm install jruby ; rvm use jruby
Sure enough, my .gemrc file (located at ~/.gemrc) had those two lines. I removed them for the install, and voilá, everything ran perfectly.
(After the install I added those two lines back in. You can find out more about what they do and other gem commands at the RubyGems guides.)