How to update Ruby 2.0 to the latest version of Ruby on Mac OS X Yosemite?

Hi,

Mac OS X Yosemite comes included with Ruby 2.0. But when you are working with the latest version of Rails[4.2], you might be in need of the latest version of Ruby [2.2] to have better performance. So, how do you update Ruby? There is a simple solution for this is to use Ruby Version Manager (RVM), which is a standard for upgrading ruby on OSX.

To do this. Open your terminal and run

\curl -L https://get.rvm.io | bash -s stable –ruby

When this is complete, you need to restart your terminal for the rvm to work.

Now, run rvm list known 

This shows the list of versions of the ruby.

Now, run rvm install ruby-2.2.0

If you type ruby -v in the terminal, it still shows you ruby 2.0.

To use the latest installed version. Run rvm use ruby-2.2.0

Now, when you look at the version, it shows you the following:

ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]

There you go, you have the latest version of ruby now in use.

Cheers,

SZ

4 comments

  1. Hi Sri,

    I tired to run “rvm install ruby-2.2.0” after I ran “\curl -L https://get.rvm.io | bash -s stable –ruby” but get this error:
    ~ me$ rvm install ruby-2.2.0
    -bash: rvm: command not found

    I have El Capitan installed and this ruby 2.0.0p645 version. I wanted to install jekyll initially but it didn’t work. So I thought it might be that ruby is not up to date.

    I’m not so versatile with the terminal. I hope that I can update ruby and get jekyll running.

    Cheers, Gabriel

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s