Unable to install gem on mountain lion?

101 views
Skip to first unread message

wragen22

unread,
Sep 17, 2012, 7:29:44 PM9/17/12
to rubyonra...@googlegroups.com
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. 

Timster

unread,
Sep 18, 2012, 3:29:24 PM9/18/12
to rubyonra...@googlegroups.com
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:

wragen22

unread,
Sep 18, 2012, 3:53:13 PM9/18/12
to rubyonra...@googlegroups.com
Hm.. Interesting.  I went and installed the extra extension into xcode.  but now getting a different output.

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb 
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... yes
checking for libexslt/exslt.h... yes
checking for iconv_open() in iconv.h... no
checking for iconv_open() in -liconv... yes
checking for xmlParseDoc() in -lxml2... yes
checking for xsltParseStylesheetDoc() in -lxslt... yes
checking for exsltFuncRegister() in -lexslt... yes
checking for xmlHasFeature()... yes
checking for xmlFirstElementChild()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetValidStructuredErrors()... yes
checking for xmlSchemaSetValidStructuredErrors()... yes
checking for xmlSchemaSetParserStructuredErrors()... yes
creating Makefile

make
/usr/bin/gcc-4.2 -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I. -DHAVE_XMLHASFEATURE -DHAVE_XMLFIRSTELEMENTCHILD -DHAVE_XMLRELAXNGSETPARSERSTRUCTUREDERRORS -DHAVE_XMLRELAXNGSETPARSERSTRUCTUREDERRORS -DHAVE_XMLRELAXNGSETVALIDSTRUCTUREDERRORS -DHAVE_XMLSCHEMASETVALIDSTRUCTUREDERRORS -DHAVE_XMLSCHEMASETPARSERSTRUCTUREDERRORS -I-I-I/opt/local/include -I-I-I/usr/local/include -I-I-I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/include -I-I-I/usr/include -I-I-I/usr/include/libxml2 -I/usr/local/Cellar/libxml2/2.8.0/include/libxml2 -I/opt/local/include/libxml2 -I/usr/local/include/libxml2 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/include/libxml2 -I-I/opt/local/include -I-I/usr/local/include -I-I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/include -I-I/usr/include -I-I/usr/include/libxml2 -I/opt/local/include -I/usr/local/include -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/include -I/usr/include -I/usr/include/libxml2  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common  -g -Os -pipe -fno-common -DENABLE_DTRACE  -fno-common  -pipe -fno-common   -g -DXP_UNIX -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline  -c html_document.c
make: /usr/bin/gcc-4.2: No such file or directory
make: *** [html_document.o] Error 1


Gem files will remain installed in /Users/bradwrage/.bundler/tmp/19839/gems/nokogiri-1.5.5 for inspection.
Results logged to /Users/bradwrage/.bundler/tmp/19839/gems/nokogiri-1.5.5/ext/nokogiri/gem_make.out
An error occurred while installing nokogiri (1.5.5), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.5.5'` succeeds before bundling.

wragen22

unread,
Sep 18, 2012, 4:25:31 PM9/18/12
to rubyonra...@googlegroups.com
Ah...fixed with homebrew and these instructions here.



Thanks!
Reply all
Reply to author
Forward
0 new messages