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:
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