Text

Installing Ruby 1.9.2 or Ruby Enterprise Edition in OS X Lion with RVM

Using MacPorts you can install Ruby Enterprise Edition, as well as Ruby 1.9.2 for the local user in OS X Lion while having Xcode 4.2 installed by using “Apple’s version of gcc 4.2.”

Note: The reason I mention Xcode 4.2 is that Apple removed gcc-4.2 in Xcode 4.2 for llvm-gcc-4.2.

Prerequisites:

  • OS X Lion (tested in 10.7.2)
  • Xcode 4.2
  • rvm 1.9.1
  • MacPorts 2.0.3

Execute the following commands:

$ sudo port install apple-gcc42

$ export CC=/opt/local/bin/gcc-apple-42

then

rvm install 1.9.2

rvm use 1.9.2 —default

or

rvm install ree

rvm use ree —default

Note: Ruby 1.9.3 was just released and should not require apple-gcc-42

Notes:

  1. joeglenn posted this