2

I recently followed some instructions with RVM to install ruby-debug and I think it might have caused some problems. The link that I found the instructions are here: http://beginrescueend.com/support/troubleshooting/

The commands I used to install are the following:

$ rvm reinstall 1.9.3 --patch debug --force-autoconf
$ gem install ruby-debug19 -- --with-ruby-include="${MY_RUBY_HOME/rubies/src}"

Now, when I try to start the rails server, I receive the following error:

./bundler_stubs/rails:13:in `require': no such file to load -- rubygems (LoadError)
from ./bundler_stubs/rails:13

This SO question would lead me to believe that I have more than one version of rails installed: no such file to load -- rubygems (LoadError)

However, when I run which -a ruby as the selected answer suggests, I only receive /usr/bin/ruby. Any thoughts on what to do here?

Community
  • 1
  • 1
Nick
  • 9,493
  • 8
  • 43
  • 66

2 Answers2

5

You need to explicitly activate the installed Ruby version before using it.

rvm use 1.9.3

which ruby should now point to the new version.

You can set a default Ruby version with

rvm --default 1.9.3

Another option is to have that Ruby version activated in your project folder. This can be achieved by placing a .rvmrc file there. E.g.

echo "rvm use 1.9.3" >> /project/folder/.rvmrc

Now you will need to install all your gems (including rubygems, rails etc.) for that particular (rvm) Ruby version, e.g.

gem install ruby-debug19
simonnordberg
  • 2,794
  • 1
  • 16
  • 7
  • `rvm use 1.9.3 --default` did the trick. For whatever reason, the current version was set to 1.8.7, but I don't know why that is because it used to be default to 1.9.3. – Nick Mar 29 '12 at 21:31
0

Try adding [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" to your .bash_profile (if you're on a Mac) or your .bashrc (if you're in Linux). Seems like your RVM path isn't being loaded, so the wrong Ruby version is being called.

jnevelson
  • 2,092
  • 2
  • 21
  • 31