Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.