Phusion white papers Phusion overview

Installing Ruby Enterprise Edition on OS X Lion

By Hongli Lai on October 1st, 2011

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
  • Tony

    Ran into this yesterday! Thanks for the solution.

  • Matt

    gcc is no longer included in xcode 4.2. do you have plans to support clang or llvm-gcc in the near future?

  • Tom

    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?

  • http://mekyle.com Kyle

    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.

  • http://mekyle.com Kyle

    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`

  • http://www.railscrackers.com/ Shan

    Hi,

    you might get the following errors when you installing ree, so i would like to add some comments on this:

    Error running ‘patch -F 25 -p1 -N -f “../../.rvm/patches/ree/1.8.7/tcmalloc.patch”‘,, please read /../../.rvm/log/ree-1.8.7-2012.02/patch.apply.tcmalloc.log

    Error running ‘patch -F 25 -p1 -N -f <"/../../.rvm/patches/ree/1.8.7/stdout-rouge-fix.patch"', please read /../../.rvm/log/ree-1.8.7-2012.02/patch.apply.stdout-rouge-fix.log

    If you got those error then please do the following:
    $ rvm remove ree
    $ export CC=/usr/bin/gcc-4.2
    $ rvm install –force ree

    i hope that it should go well..

    thanks