Joshua Clark
Joshua Clark

Reputation: 1356

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 PATH=/usr/share/ruby-rvm/gems/ruby-1.9.2-p180:$PATH to .bashrc, then restarting and still, the wrong version of RVM. After doing that, my path says:

$ echo $PATH
/usr/share/ruby-rvm/gems/ruby-1.9.2-p180/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

But if I navigate to /usr/share/ruby-rvm/gems/ruby-1.9.2-p180/bin, the only executable in the directory is rake. So I figured it just wasn't installed right, so I ran rvm install 1.9.2 and the directory is still the same.

Upvotes: 0

Views: 3921

Answers (1)

mpapis
mpapis

Reputation: 53158

You have a mix of two issues - both come from Ubuntu:

  1. RVM was installed via apt-get, to solve use: Installed Ruby 1.9.3 with RVM but command line doesn't show ruby -v

  2. You are using gnome-terminal, to solve use: https://rvm.io/integration/gnome-terminal/

Upvotes: 2

Related Questions