Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I replaced a broken logic board on my MacBook Pro and have OS X Snow Leopard reinstalled without XCode.

I installed gems successfully without running into any errors, but when I tried installing rails it gives me an error:

Error: failed to build gem native extension.

I searched on the web and Stack Overflow guided me to upgrade to OS X Lion. I installed the Lion compatible Xcode 4.3, then installed the command line tools.

Now Rails installed just fine.

I thought Xcode is just an IDE. Why does it have anything to do with Rails?

share|improve this question

From: Don’t be terrified of building native extensions! - Pat Shaughnessy

The native extension is some C code that’s included inside the Ruby gem that calls the external component’s API, converting the parameters and return values between the format the external library needs and what the Ruby interpreter expects.

The Xcode installer package contains all the developer tools for OS X. Without Xcode installed, you don't have a C/C++/Objective-C compiler installed. When you install Xcode, it installs GCC and Clang-LLVM, and many other developer tools, including most of the GNU toolchain, make, etc.

share|improve this answer
I added a link to an article that explains why Rails really would need Xcode. Hope you don't mind. – slhck Jul 17 '12 at 11:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .