Mac OS X Yosemite came with Ruby 2.0 out of the box, so I thought that I would like to update it to one of the latest stable builds: 2.2. I came across posts talking about Ruby Version Manager (rvm) and decided to install Ruby 2.2 using it. The rvm site has a good installation guide but I filtered out what I actually needed.
Firstly, I opened up Terminal.app to check on my Ruby version with
Then I ran the following line to install rvm
\curl -L https://get.rvm.io | bash -s stable –ruby
Post installation, I restarted Terminal and ran the following to display a list of all known rubies
rvm list known
To install a version of Ruby, I went with
rvm install 2.2
Once the installation has been completed, I checked my Ruby version again
Mac:~ user$ ruby -v ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14]
Great! Now I am updated to Ruby 2.2.