views:

124

answers:

2

Today I installed jruby by downloading it, extracting it to /home/james/jruby-1.4.0

and adding the following line 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 seemed to have cause two problems:

1) 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.

2) 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.

Please help.

+1  A: 

Change your path line in your .bashrc to be like this:

export PATH=$PATH:$JRUBY_HOME/bin

Then your gem command will find the MRI one first.

To invoke the jruby gem command use the -S switch, e.g.

jruby -S gem list --local

Rob
A: 

Use following command to list ruby gem

ruby -S gem list -l

sunils