Installing Ruby Enterprise Edition on OS X Lion
We’ve received some reports about users being unable to install Ruby Enterprise Edition on OS X Lion. Apparently the compilation process segfaults. It turns out that OS X Lion has switched to llvm-gcc as the default compiler. We currently suspect that the segfaults are caused by incompatibility between llvm-gcc’s code generation and the MBARI patch set (similar problems have been seen in the past but with other compilers on other platforms).
To install Ruby Enterprise Edition on Lion one needs to force the compiler to plain GCC instead of llvm-gcc. This can be done by setting the environment variable CC to /usr/bin/gcc-4.2. For example:
$ sudo bash # export CC=/usr/bin/gcc-4.2 # ./installer
Or, when using RVM (from Stack Overflow):
$ rvm remove ree $ export CC=/usr/bin/gcc-4.2 $ rvm install --force ree
Phusion. All rights reserved.
Ran into this yesterday! Thanks for the solution.
gcc is no longer included in xcode 4.2. do you have plans to support clang or llvm-gcc in the near future?
I don’t have /usr/bin/gcc-4.2 and neither Xcode 4.1 nor Xcode 4.2 seems to want to install it for me…
Any advice?
Hey guys,
I also found GCC not included with the latest build of xCode.
I’m going to give https://github.com/kennethreitz/osx-gcc-installer a try later today.
At the moment I’m dual booted onto snow leopard to get work done.
I can confirm,
Installing the custom GCC at https://github.com/kennethreitz/osx-gcc-installer resolves my issue.
`CC=/usr/bin/gcc-4.2 rvm install ree –force`