How do I upgrade my ruby 1.9.2-p0 to the latest patch level using rvm? How do I upgrade my ruby 1.9.2-p0 to the latest patch level using rvm? ruby ruby

How do I upgrade my ruby 1.9.2-p0 to the latest patch level using rvm?


First of all, update your RVM installation by running rvm get stable.

To make sure you're running the new RVM version, you'll then need to run rvm reload (or just open a new terminal).

Once that's done, you can ask RVM to list the ruby versions available to install by running rvm list known.

In the output you should now see:

# MRI Rubies...[ruby-]1.9.2[-p320]...

The square brackets around the patch level indicate that this is currently RVM's default patch level for ruby 1.9.2.

Finally, to install the new ruby version, just run rvm install 1.9.2 - and wait for it to compile!


Upgrade ruby interpreter and keep existing gemsets:

$ rvm upgrade 1.9.2-p0 1.9.2Are you sure you wish to upgrade from ruby-1.9.2-p0 to ruby-1.9.2-p136? (Y/n): Y

To replace with the latest stable release of 1.9.2. This avoids clutter.

Some additional helpful tips, thanks to comments (@Mauro, @James, @ACB)

$ rvm list known# NOTE: you probably want to upgrade your rvm first, as the list of known rubies seems to be coupled to the rvm version.$ rvm get stable$ rvm list known #pick your ruby


First update RVM:

rvm get stable

Then update your Ruby version:

rvm upgrade 2.0.0

Choose yes for all the questions:

Are you sure you wish to upgrade from ruby-2.0.0-p195 to ruby-2.0.0-p247? (Y/n): YAre you sure you wish to MOVE gems from ruby-2.0.0-p195 to ruby-2.0.0-p247?This will overwrite existing gems in ruby-2.0.0-p247 and remove them from ruby-2.0.0-p195 (Y/n): YDo you wish to move over aliases? (Y/n): YDo you wish to move over wrappers? (Y/n): YDo you also wish to completely remove ruby-2.0.0-p195 (inc. archive)? (Y/n): Y

If you wish to update your gems to the latest versions, you can do:

rvm all do gem update

EDIT: I just did this today for the latest version of ruby 2.0.0 (I updated from ruby-2.0.0-p195 to ruby-2.0.0-p353). After that, I was getting segmentation fault when I tried to update gems. This happens because the gems were installed for ruby-2.0.0-p195 and some of them are incompatible with p353.

Now you can go and try to find the gems that are incompatible, but the easiest solution was to remove all installed gems and install them again. I simply removed gems/ruby-2.0.0-p353 directory that was located in /usr/local/rvm. It could be somewhere else for you.

Then I ran gem install bundler and for each of my rails apps I did bundle install.