Updating ruby in Mac OS

5/2014 These instructions failed on Snow leopard 10.6.8 – see following note:

Note: To install rvm, there are some dependencies – for example gcc – If you have not installed xcode developer tools, or any typical linux tools – rvm will try to install homebew and probably fail. So it may not be practical to update your version of Ruby this way…

original post

Used rvm – explained here – but I have extracted relevant instructions below:

http://stackoverflow.com/questions/3696564/how-to-update-ruby-to-1-9-x-on-mac

start here:

1. Update /etc/paths as explained here:

sudo nano /etc/paths

Add 2 following lines:

/opt/local/bin
/opt/local/sbin

 

then reboot your terminal

2. Then install rvm:

As The Tin Man suggests (above) RVM (Ruby Version Manager) is the Standard for upgrading your Ruby installation on OSX: https://rvm.io

To get started, open a Terminal Window and issue the following command:

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

( you will need to trust the RVM Dev Team that the command is not malicious – if you’re a paranoid penguin like me, you can always go read the sourcehttps://github.com/wayneeseguin/rvm )

3. When it’s complete you need to restart the terminal

4. To get the rvm command working.

rvm list known

( shows you the latest available versions of Ruby )

rvm install ruby-2.0.0-p247

For a specific version, followed by

rvm use ruby-2.0.0-p247

or if you just want the latest (current) version:

rvm install current
rvm use current

( installs the current stable release – at time of writing ruby-2.0.0-p247 – please update this wiki when new versions released )