Ref: CranialPulse: How to install Ruby and Rails on Mountain Lion as of now
- Install XCode from the App Store
- Install XCode Command Line Tools (Open XCode, Preferences, Downloads)
- In Terminal, run
sudo xcodebuild -license agree
- Download the Mountain Lion installer from http://www.macports.org/install.php
- After install, run
sudo port selfupdate
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/patchcurl -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 --defaultIf you still have issues building native gems, try this:
rvm get head
rvm --force install 1.9.3