How can I install Ruby 1.9.3 in Mac OS X Lion? How can I install Ruby 1.9.3 in Mac OS X Lion? ruby ruby

How can I install Ruby 1.9.3 in Mac OS X Lion?


Try using the clang compiler instead of the default:

rvm install 1.9.3 --with-gcc=clang


RVM needs gcc-4.2 to be able to install ruby 1.9.3.Unfortunately Lion does not include anymore gcc-4-2, just the llvm version:

lrwxr-xr-x  1 root  wheel  12 15 feb 17:21 /usr/bin/gcc -> llvm-gcc-4.2

If you have Lion but upgraded from Snow Leopard it is likely that you still have gcc-4.2 If you have a brand new installation of Lion you should download gcc-4.2. I recommned downloading this package.

https://github.com/kennethreitz/osx-gcc-installer

Check that you have gcc-4.2 installed now:

-rwxr-xr-x  1 root  wheel  113024 16 may  2011 /usr/bin/gcc-4.2lrwxr-xr-x  1 root  wheel      12 15 feb 17:21 /usr/bin/gcc -> llvm-gcc-4.2

Now you can install ruby 1.9.3 as usual:

rvm install 1.9.3rvm use 1.9.3 --default


If you want to merely install and keep up to date the latest version of Ruby (as opposed to switching between different versions of ruby), you can install ruby via homebrew:

brew install ruby