Main Navigation

Ever since Xcode 4.2, which removed gcc in favor of clang, ruby 1.8 (and some versions of 1.9, and many gems with native code) wouldn’t compile or wouldn’t work correctly when compiled. There was a workaround, in the form of the osx-gcc-installer. It was a little bit hacky – but the work and the author, Kenneth Reitz, were basically responsible for making the command-line tools package happen.

Now it’s very easy to get a full compiler environment, including pure gcc (rather than clang’s emulation of it), that can build all variants of ruby and gems without an issue. The trivial process goes like this:

First, download and install the Command Line Tools for Xcode. These can be installed either through Preferences > Downloads > Components in the full Xcode 4.3 install, or by downloading and installing the standalone package.

Next, install homebrew, a fantastic package manager for OS X. Run brew update to make sure it’s fully up to date.