Skip to content

Instantly share code, notes, and snippets.

@yoeun
Created December 15, 2012 20:51
Show Gist options
  • Select an option

  • Save yoeun/4299070 to your computer and use it in GitHub Desktop.

Select an option

Save yoeun/4299070 to your computer and use it in GitHub Desktop.
How to install Ruby on OS X Mountain Lion (10.8)

How to install Ruby on OS X Mountain Lion (10.8)

Ref: CranialPulse: How to install Ruby and Rails on Mountain Lion as of now

Install XCode

  1. Install XCode from the App Store
  2. Install XCode Command Line Tools (Open XCode, Preferences, Downloads)
  3. In Terminal, run sudo xcodebuild -license agree

Install Mac Ports

  1. Download the Mountain Lion installer from http://www.macports.org/install.php
  2. After install, run sudo port selfupdate

Install GCC

sudo port install apple-gcc42
sudo port install gmake
sudo port install gpatch
sudo ln -s /opt/local/bin/gcc-apple-4.2 /opt/local/bin/gcc
sudo ln -s /opt/local/bin/gmake /opt/local/bin/make
sudo ln -s /opt/local/bin/gpatch /opt/local/bin/patch

Install RVM

curl -L https://get.rvm.io | bash -s stable --ruby
source ~/.rvm/scripts/rvm
rvm install 1.9.3-p327
rvm use 1.9.3-p327 --default

If you still have issues building native gems, try this:

rvm get head
rvm --force install 1.9.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment