简体   繁体   中英

Why can't I change my Ruby version using RVM?

I am currently trying to switch my default version of Ruby from 1.9.3 to 1.9.2-p280.

I ran these in my console:

  1. sudo apt-get install ruby-rvm
  2. rvm install 1.9.2-p290
  3. rvm --default use 1.9.2-p290
  4. ruby -v

The output of step 4 is:

ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]

Any advice is greatly appreciated.

Are you in the same session where you invoke: rvm --default use 1.9.2-p290 and ruby -v ?

Please take a look at the answer here for detailed explanation: Why do I need to use "rvm use default" after opening new terminal window?

I'm pretty sure that "ruby 1.9.3p0" is the default that installs from the Ubuntu packages. Run:

which ruby

and that will tell you for sure. Where RVM installs its Rubies depends on whether you chose the "system" or "user" installation. But everything may already be working, just reload your shell by opening another terminal.

To make sure this is the problem, run:

env | grep RUB

you should see two environmental variables, MY_RUBY_HOME and RUBY_VERSION . If you don't see them, then the RVM installer failed to put them in for your shell. If we know what shell you are using, we can help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM