Andrew Bucknell
Andrew Bucknell

Reputation: 1950

rvm use 1.9.2 leaves me using ruby 1.8.7

I dont understand why after the rvm command I am still on ruby 1.8.7. Ive followed the install instructions for rvm and it all seemed to go fine - where do I look to start resolving this?

andrew@unifex:~$ rvm use 1.9.2 --default
Using /home/andrew/.rvm/gems/ruby-1.9.2-p290
andrew@unifex:~$ ruby -v
ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]
andrew@unifex:~$

andrew@unifex:~$ rvm info

ruby-1.9.2-p290:

  system:
    uname:       "Linux unifex 2.6.22-3-amd64 #1 SMP Sun Nov 4 18:18:09 UTC 2007 x86_64 GNU/Linux"
    bash:        "/bin/bash => GNU bash, version 3.1.17(1)-release (x86_64-pc-linux-gnu)"
    zsh:         " => not installed"

  rvm:
    version:      "rvm 1.9.2 by Wayne E. Seguin ([email protected]) [https://rvm.beginrescueend.com/]"

  ruby:
    interpreter:  "ruby"
    version:      "1.9.2p290"
    date:         "2011-07-09"
    platform:     "x86_64-linux"
    patchlevel:   "2011-07-09 revision 32553"
    full_version: "ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]"

  homes:
    gem:          "/home/andrew/.rvm/gems/ruby-1.9.2-p290"
    ruby:         "/home/andrew/.rvm/rubies/ruby-1.9.2-p290"

  binaries:
    ruby:         "/home/andrew/.rvm/rubies/ruby-1.9.2-p290/bin/ruby"
    irb:          "/home/andrew/.rvm/rubies/ruby-1.9.2-p290/bin/irb"
    gem:          "/home/andrew/.rvm/rubies/ruby-1.9.2-p290/bin/gem"
    rake:         "/home/andrew/.rvm/gems/ruby-1.9.2-p290/bin/rake"

  environment:
    PATH:         "/home/andrew/.rvm/gems/ruby-1.9.2-p290/bin:/home/andrew/.rvm/gems/ruby-1.9.2-p290@global/bin:/home/andrew/.rvm/rubies/ruby-1.9.2-p290/bin:/home/andrew/.rvm/bin:/usr/local/java/jdk1.6.0_20/bin:/usr/local/apache/maven/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/local/java/jdk1.6.0_03/bin"
    GEM_HOME:     "/home/andrew/.rvm/gems/ruby-1.9.2-p290"
    GEM_PATH:     "/home/andrew/.rvm/gems/ruby-1.9.2-p290:/home/andrew/.rvm/gems/ruby-1.9.2-p290@global"
    MY_RUBY_HOME: "/home/andrew/.rvm/rubies/ruby-1.9.2-p290"
    IRBRC:        "/home/andrew/.rvm/rubies/ruby-1.9.2-p290/.irbrc"
    RUBYOPT:      ""
    gemset:       ""

Upvotes: 2

Views: 1551

Answers (1)

stef
stef

Reputation: 14268

I had this exact problem. It's down to your $PATH not being correct - /usr/bin/ruby is found before rvm gets a chance to do its thing.

In your ~/.bash_profile (As in /Users/andrew/.bash_profile) ensure you have this line present at the bottom of the file:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

Then open a new shell

rvm reload
rvm use 1.9.2 --default
ruby -v

You should now have the correct version displayed.

Upvotes: 4

Related Questions