wnoveno
wnoveno

Reputation: 546

Upgrading Ruby from 1.8.7 to 1.9.3 when 1.8.7 is not under rvm

I have ruby 1.8.7 as the default version in my machine. The problem is it's not under RVM and switching to 1.9.3 does nothing.

How can I uninstall 1.8.7 and make 1.9.3 the default ruby version?

Upvotes: 3

Views: 840

Answers (2)

Adam Eberlin
Adam Eberlin

Reputation: 14205

$ rvm list

rvm rubies
   ruby-1.8.6-p420 [ x86_64 ]
   ruby-1.8.7-p334 [ x86_64 ]
=> ruby-1.9.2-p180 [ x86_64 ]
   ruby-1.9.3-p194 [ x86_64 ]

$ rvm remove 1.8.7-p334

Removing /usr/local/rvm/src/ruby-1.8.7-p334...
Removing /usr/local/rvm/rubies/ruby-1.8.7-p334...
Removing ruby-1.8.7-p334 aliases...
Removing ruby-1.8.7-p334 wrappers...
Removing ruby-1.8.7-p334 environments...
Removing ruby-1.8.7-p334 binaries...

$ rvm use --default 1.9.3-p194

Using /usr/local/rvm/gems/ruby-1.9.3-p194

$ rvm list

rvm rubies
   ruby-1.8.7-p334 [ x86_64 ]
   ruby-1.9.2-p180 [ x86_64 ]
=> ruby-1.9.3-p194 [ x86_64 ]

Use rvmsudo rvm if you installed RVM as root and want your changes to be reflected for all users.

Edit: I just realized you said 1.8.7 was on the system by default. Just install RVM as root and install 1.9.3, and set as default as I have described above using rvmsudo. Make sure you use the newest version of RVM. Cheers.

Upvotes: 2

Benjamin Tan Wei Hao
Benjamin Tan Wei Hao

Reputation: 9691

What machine are you on? One way is rvm use 1.9.3 --default. If that doesn't work for you on the console, consider putting that on the last line of your ~/.zshrc or ~/.bashrc -- Whichever shell you use.

Upvotes: 0

Related Questions