Why does Ruby or RVM seem stuck at 1.8.7 on Linux

2019-06-04 08:05发布

问题:

I am on Linux Mint 12.

I installed RVM and ran these commands:

rvm 1.9.2

rvm --default use 1.9.2

but ruby -v still outputs ruby 1.8.7.

sudo apt-get install ruby1.9.2 returns saying 1.9.1 is the latest version.

How do I get Ruby to be running on 1.9.2?

When I run rvm list like suggested at "Ruby 1.9.2 keeps reverting back to 1.8.7 after installing it using RVM", it outputs:

rvm rubies

   ruby-1.8.7-p352 [ x86_64 ]
=> ruby-1.9.2-p290 [ x86_64 ]

So I think I must have a configuration issue. My OS seems to be defaulting to the wrong version of Ruby.

I ran:

sudo apt-get remove ruby

But had no change.

回答1:

You add string [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" into ~/.bashrc? First, show your echo $PATH output. If this looks like (rvm paths before system paths):

/home/ayunin/.rvm/gems/ruby-1.9.3-rc1/bin:/usr/bin:/bin:/usr/bin/X11

Then you ran into the magick. Restart your terminal, and show ruby version. If does not work - you can launch rvm implode and reinstall all, yes.



回答2:

It looks like Linux Mint 12 has ruby-rvm already installed (at least on my machine) so could this be a problem?

you can stick with that but then I think you will need to add your username to the rvm group with usermod -a -G username rvm.

I removed removed ruby-rvm completely (with apt-get) and then followed the installation instructions from https://rvm.beginrescueend.com/rvm/install/ for 'single user' thus all my rvm files are located in ~/.rvm/bin/rvm I added the line for rvm in my .bashrc and tested with 1type rvm | head -1`.

After that rvm install 1.9.2 just worked and I installed it into ~/.rvm/rubies/ruby-1.9.2

After that rvm use --default 1.9.2 set all up correctly.



标签: ruby rvm