Today I installed JRuby by downloading it, extracting it to /home/james/jruby-1.4.0, and adding the following lines to .bashrc:
export JRUBY_HOME=/home/james/jruby-1.4.0
export PATH=$JRUBY_HOME/bin:$PATH
And then I installed some JRuby gems via jruby -S gem install ...
Jruby works fine, but this seems to have caused two problems:
-
When I try to run a Ruby (not JRuby) on Rails migration, I see:
Missing the Rails gem. Please `gem install -v= rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed. -
When I do
gem list --local, I only see the gems that I’ve installed for JRuby.
Launching web applications via ruby script/server succeeds without any warnings.
Change your path line in your .bashrc to be like this:
export PATH=$PATH:$JRUBY_HOME/binThen your
gemcommand will find the MRI one first.To invoke the jruby gem command use the -S switch, e.g.
jruby -S gem list --local