8

I just updated my Macbook to Mountain Lion, but now I'm not able to install some gems, because of the below error about headers. I looked around and it seems to have to do with Ruby headers missing. It was suggested to install Xcode, so I installed the full Xcode from the app store and also the Xcode command line tools. But still no luck. Any suggestions?

ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
checking for ffi.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.
John
  • 6,404
  • 14
  • 54
  • 106

2 Answers2

26

Be sure to install Xcode's Command-Line Tools.

This hint helped me with this issue:

sudo ln -s /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2
Koraktor
  • 41,357
  • 10
  • 69
  • 99
  • 1
    Major props!! Somehow 10.8 uninstalled my cmd line tools? wtf? – OneChillDude Aug 20 '12 at 17:32
  • Wow! This worked perfectly for me. (I just changed the command to my GCC version, 4.5.0.) I'm using OS Mavericks, so the same issue is still pertinent in 10.9. – CodeBiker Oct 28 '13 at 17:22
2

I was able to get things working by just installing "Command Line Tools 10.8 for Xcode - Late July 2012" (not XCode itself) from:

FYI, I did not have XCode installed on Lion, just the "Command Line Tools". Not sure if the new XCode command line tools will play nice with the old XCode.

bowsersenior
  • 12,524
  • 2
  • 46
  • 52
  • I was looking for the 10.8 command line tools download,but couldn't find them, so thanks for the link. – John Jul 27 '12 at 19:50