Matteo Agosti

Software engineer

Compiling Ruby Extensions With Xcode 4.3

Today I decided to try out Octopress for handling my personal website. As always, things never go as smooth as it should be, otherwise where is the fun?

The major flaw I had to face was the failure in compiling some Ruby extensions, apparently due to missing header files and binaries.

My system currently runs OS X 10.7.4 with Xcode 4.3 and the standalone command line tools installed (the latter is not any longer packaged into Xcode and has to be installed manually).

After having checked that all required libs and tools were installed on my system I started to think on a path-related issue. Before Xcode 4.3, in fact, all dev related stuff was stored in /Developer, whereas since Xcode 4.3 everything is packed inside the application folder itself.

I found out the handy command line tool xcode-select whose responsability is to manage the path for Xcode and UNIX tools and decided to force the new path:

sudo xcode-select -switch /Applications/

That did the trick and the fact that you are reading this on Octopress proves its success :P

If you want to discuss about this article, I'm @matteoagosti on Twitter.