Upgrading to Ruby 2.0

If you are using the rvm for managing Ruby versions and are in Ruby 1.9.X version and want to upgrade to Ruby 2, this blog will help.  So hoping that you have installed rvm on your system this is how you upgrade to Ruby 2.0

First in your bash / terminal you need to tell rvm to check for latest stable release of Ruby. For that type this command (of course without the $)

$ rvm get stable

This will update rvm  with latest stable releases. Now you can get the list of known by typing this command

$ rvm list known

This will list some stuff like this

# MRI Rubies

Notice that you have [ruby-]2.0.0[-p0] which is nothing but but Ruby 2.0,to install it type this

$ rvm install 2.0.0

Once installed to use Ruby 2.0 just type this

$ rvm use 2.0.0

Now how to switch to other versions of Ruby, well just type

$ rvm list

This will list the versions of ruby available in your system, the following is the out put in my system

rvm rubies

=* ruby-1.9.3-p362 [ x86_64 ]
ruby-2.0.0-p0 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

This shows I have Ruby 2.0 and Ruby 1.9.3-p362. To switch to  Ruby 1.9.3-p362 (in my case) type

$ rvm use 1.9.3-p362

and you would have switched to that version of Ruby!!!


, , ,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: