A Few Mountain Lion Issues…
With Mountain Lion and the Xcode update, it looks like some command line tools are missing which cause some gems/software to not compile. For example:
hadricus@solaris:~/Development/Ruby/rails/blog (local)$ bundle install
Fetching source index for http://rubygems.org/
Installing rake (0.9.2.2)
Installing RedCloth (4.2.9) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/hadricus/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
checking for main() in -lc... *** 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.
Here’s how to fix it.
- Install the command line tools from within Xcode. Open up Xcode and bring up the Preferences. In the Downloads tab, install the Command Line Tools.
- Open a Terminal and enter the following command:
sudo ln -s /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2
Enter your password if required.
Everything should now compile as per normal.