Default Ruby Version Set with Rvm Not Recognized by System

Default Ruby Version Set with Rvm Not Recognized by System

I'm trying to get the system to use the Ruby version I've set with RVM. The following commands produce this output:

$ rvm use 1.9.2 --default
Using /usr/share/ruby-rvm/gems/ruby-1.9.2-p180
$ rvm current
ruby-1.9.2-p180
$ ruby --version
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

Here's the contents of my PATH: PATH=/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

Also:

$ whereis ruby
ruby: /usr/bin/ruby /usr/bin/ruby1.8 /usr/lib/ruby /usr/share/man/man1/ruby.1.gz
$ whereis rvm
rvm: /usr/bin/rvm /usr/share/man/man1/rvm.1.gz

I assume this is an issue of environmental variables, but I don't really know what to do beyond that.

I've tried rvm system, then rvm list and rvm current only list 1.9.2 with ruby --version listing 1.8.7 still

I've also tried adding export /usr/share/ruby-rvm/gems/ruby-1.9.2-p180:$PATH to .bashrc, then restarting and still.

0

1 Answer

The ruby-1.9.2../bin path needs to be in your PATH in front of any other ruby. rvm use 1.9.2 should be putting it there, not sure why it would not. Mine is a little different since I use a private rvm installation (in my ~/)

Maybe this will help you:

jeremy@octavian:~$ rvm use 1.9.2
Using /home/jeremy/.rvm/gems/ruby-1.9.2-p290
jeremy@octavian:~$ ruby --version
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
jeremy@octavian:~$ which ruby
/home/jeremy/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
jeremy@octavian:~$ echo $PATH
/home/jeremy/.rvm/gems/ruby-1.9.2-p290/bin:/home/jeremy/.rvm/gems/ruby-1.9.2-p290@global/bin:/home/jeremy/.rvm/rubies/ruby-1.9.2-p290/bin:/home/jeremy/.rvm/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Sarah Jenkins
Author

Sarah Jenkins

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.