Last Updated: February 25, 2016
·
1.106K
· marvin-yorke

Installing Ruby 2.0.0 on Mac OS 10.8.2 with MacPorts

As Ruby experiences some problems installing on Mac OS 10.8.2, here's the way I've managed to deal with it.
First you need to install XCode command line tools from here https://developer.apple.com/xcode/

Create file ~/.rvmrc with the following content:

export CFLAGS="-O2 -arch x86_64"
export LDFLAGS="-L/opt/local/lib"
export CPPFLAGS="-I/opt/local/include"

Then install openssl library using MacPorts and Ruby using RVM

sudo port install openssl +universal
export CC=gcc
rvm install 2.0.0 --with-openssl-dir=/opt/local/ --with-opt=/opt/local/

Optionally you can install Rails as usual:

gem install rails

Voila!