Unable to install gem on mountain lion?

Hello,

I’m trying to install a specific gem but getting this error message below.

ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can’t find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h

Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/nokogiri-1.5.5 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/nokogiri-1.5.5/ext/nokogiri/gem_make.out

I’ve seen that some folks have resolved this issue by reinstalling the new version of x-code. Which I did - but no avail.

Any tips?

Thanks.

In new versions of XCode you need to specifically install the command line tools for this to work.

Check here for a screenshot of how to:

http://www.zlu.me/blog/2012/02/21/install-native-ruby-gem-in-mountain-lion-preview/

Hm… Interesting. I went and installed the extra extension into xcode. but now getting a different output.

Ah…fixed with homebrew and these instructions here.

http://cczona.com/blog/2012/07/fix-for-make-usrbingcc-4-2-no-such-file-or-directory/

Thanks!