Installing Nokogiri Fails on OS X Mavericks _ Jasdeep Singh

Embed Size (px)

Citation preview

  • 8/2/2014 Installing Nokogiri Fails on OS X Mavericks | Jasdeep Singh

    http://jasdeep.ca/2013/10/installing-nokogiri-fails-os-x-mavericks/ 1/7

    JasdeepSinghPassionate Ruby, Ruby on Rails, JavaScript, CoffeeScript Developer based out of Toronto.

    InstallingNokogiriFailsonOSXMavericksOctober 28, 2013

    So, I upgraded to OS X Mavericks this weekend. The upgrade went smooth and everything had been runningextremely fine for me until today. I wanted to install the Ruby OpenGraph gem for a project I was working on. Thisgem depends on the Nokogiri Gem. However, unfortunately I was facing this issue which was failing on building ofNokogiri Native Extensions as follows.

    1234567891011121314151617181920

    $ gem install nokogiriBuilding native extensions. This could take a while...ERROR: Error installing opengraph: ERROR: Failed to build gem native extension. /Users/jasdeep/.rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rbextconf.rb:10: Use RbConfig instead of obsolete and deprecated Config.checking for libxml/parser.h... *** extconf.rb failed ***Could not create Makefile due to some reason, probably lack ofnecessary libraries and/or headers. Check the mkmf.log file for moredetails. You may need configuration options. Provided configuration options: --with-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog

    Looking for expert help on your next software project? Contact me now!

  • 8/2/2014 Installing Nokogiri Fails on OS X Mavericks | Jasdeep Singh

    http://jasdeep.ca/2013/10/installing-nokogiri-fails-os-x-mavericks/ 2/7

    After seeing this error, I was pretty much like:

    21222324252627282930313233343536373839404142434445464748495051525354555657585960616263

    --srcdir=. --curdir --ruby=/Users/jasdeep/.rvm/rubies/ruby-1.9.3-p448/bin/ruby --with-zlib-dir --without-zlib-dir --with-zlib-include --without-zlib-include=${zlib-dir}/include --with-zlib-lib --without-zlib-lib=${zlib-dir}/lib --with-iconv-dir --without-iconv-dir --with-iconv-include --without-iconv-include=${iconv-dir}/include --with-iconv-lib --without-iconv-lib=${iconv-dir}/lib --with-xml2-dir --without-xml2-dir --with-xml2-include --without-xml2-include=${xml2-dir}/include --with-xml2-lib --without-xml2-lib=${xml2-dir}/lib --with-xslt-dir --without-xslt-dir --with-xslt-include --without-xslt-include=${xslt-dir}/include --with-xslt-lib --without-xslt-lib=${xslt-dir}/lib/Users/jasdeep/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)You have to install development tools first. from /Users/jasdeep/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp' from /Users/jasdeep/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/mkmf.rb:970:in `block from /Users/jasdeep/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for' from /Users/jasdeep/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/mkmf.rb:284:in `block from /Users/jasdeep/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/mkmf.rb:254:in `open' from /Users/jasdeep/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/mkmf.rb:284:in `block from /Users/jasdeep/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/mkmf.rb:254:in `open' from /Users/jasdeep/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/mkmf.rb:280:in `postpone from /Users/jasdeep/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for' from /Users/jasdeep/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/mkmf.rb:969:in `find_header from extconf.rb:96:in `' Gem files will remain installed in /Users/jasdeep/.rvm/gems/ruby-1.9.3-p448/gems/nokogiriResults logged to /Users/jasdeep/.rvm/gems/ruby-1.9.3-p448/gems/nokogiri-1.4.7/ext/nokogiri

  • 8/2/2014 Installing Nokogiri Fails on OS X Mavericks | Jasdeep Singh

    http://jasdeep.ca/2013/10/installing-nokogiri-fails-os-x-mavericks/ 3/7

    So, i checked the gem_make.out where the errors were logged and figured my comman line developer tools in thisnew version of OS X were pooched/missing. There is a command line tool available called xcode-select which isused to switch between different versions of XCode and Xcode in this new version of OS X comes with an update(Version 5.0.1). This little tool can be used to install the latest command line developer tools.

    This command did it for me:

    1 $ xcode-select --install

  • 8/2/2014 Installing Nokogiri Fails on OS X Mavericks | Jasdeep Singh

    http://jasdeep.ca/2013/10/installing-nokogiri-fails-os-x-mavericks/ 4/7

    Google+

    After downloading and installing the new Command Line Developer Tools:

    If this didnt worked for you, a couple people reported that their gcc was missing. Consider following this StackOverflow question if thats the case: http://stackoverflow.com/a/19643909/472869

    PS: I had a few warnings after installing the gem which Ive left out for brevity sake. These were just some encodingwarnings Nothing serious. Im hoping there wont be any major issues with Nokogiri on Mavericks.

    Jasdeep Singh

    28 Comments Jasdeep Singh Login

    Sort by Best Share

    Join the discussion

    Reply

    sally 3 months agoI would reach through the internet and hug you if i could. I have been fighting with this forso long! Thank you so much for posting this!

    5

    Favorite

    Share

    123456

    $ gem install nokogiriBuilding native extensions. This could take a while...Successfully installed nokogiri-1.6.0Installing ri documentation for nokogiri-1.6.01 gem installed$

  • 8/2/2014 Installing Nokogiri Fails on OS X Mavericks | Jasdeep Singh

    http://jasdeep.ca/2013/10/installing-nokogiri-fails-os-x-mavericks/ 5/7

    Reply

    Rob Park 6 months agoWorked for me too. Thanks!

    3

    Reply

    Rafael Rosa 2 months agoThanks, it worked :)

    1

    Reply

    narangjasdeep 2 months agoMod Rafael Rosaglad it helped. Thanks!

    Reply

    grimmdude 4 months agoThanks man, exactly what I was looking for!

    1

    Reply

    narangjasdeep 2 months agoMod grimmdudesorry for the late reply, but glad this was helpful!

    Reply

    spencer owen 4 months agoUnfortunately it didn't work for me because of this http://stackoverflow.com/quest...

    1

    Reply

    narangjasdeep 2 months agoMod spencer owenthanks for posting this link to SO, I hope it turns out to be helpful for others.

    Reply

    Gourav Tiwari 5 months agothis worked! thanks for sharing!

    1

    Reply

    mgryszko 6 months agoThanks for the tip - it worked like a charm!

    1

    Reply

    narangjasdeep 2 months agoMod mgryszkoglad I could be helpful. keep coding! ;)

    Reply

    kennygorman 14 hours agoThx!!! helped a ton.

    Jeff Kibuule 3 days agoSUCCESS!

    Share

    Share

    Share

    Share

    Share

    Share

    Share

    Share

    Share

    Share

    Share

  • 8/2/2014 Installing Nokogiri Fails on OS X Mavericks | Jasdeep Singh

    http://jasdeep.ca/2013/10/installing-nokogiri-fails-os-x-mavericks/ 6/7

    Reply

    Reply

    Alex 5 days agoThank you sir!

    Reply

    yinghau76 7 days agoYou save my day. Thank you!

    Reply

    erwin 13 days agounfortunatly, new major issues with Nokogiri on Mavericks.... seems to be the case witheach new XCode release now ...

    Reply

    Guest a month agothis worked, after struggling with the nokogiri install

    Reply

    Arpan J a month agoThis worked! Was trying to solve this for a while. Thanks much!!

    Reply

    wanlin brian a month agoThanks a lot!

    Reply

    Alex Jahraus 2 months agoThanks a lot! Installing XCode CL tools fixed this for me, however, I was unable to installthem using `xcode-select --install`, had to download the DMG from Apple:http://adcdownload.apple.com/D...

    Reply

    Chandler Roth 2 months agoI could hug you. Worked like a dream. Thanks.

    Reply

    Joel 3 months ago"Can't install the software because it is not currently available from the Software Updateserver." See this message consistently.

    Reply

    narangjasdeep 2 months agoMod JoelUnsure what's going on. At what step do you get this?

    Bryan Shanaver 8 months ago

    Share

    Share

    Share

    Share

    Share

    Share

    Share

    Share

    Share

    Share

    Share

  • 8/2/2014 Installing Nokogiri Fails on OS X Mavericks | Jasdeep Singh

    http://jasdeep.ca/2013/10/installing-nokogiri-fails-os-x-mavericks/ 7/7

    Lifestyle changes I made that helped meLoose 30lbs in roughly 4 months3 comments 3 months ago

    Ajit Singh good one jawan

    Happy Birthday Manpreet!!2 comments 9 months ago

    Satinderjit Singh hah... Nice compilationdude! :)

    Rails Pub Night, Ruby Meetups & Learn toCode Bootcamps in Toronto4 comments 10 months ago

    narangjasdeep I would highlyrecommend Eloquent Ruby for some one

    Installing Redis on Mac OS X27 comments a year ago

    AndreFigueira install brew, then do brewinstall redis

    ALSO ON JASDEEP SINGH

    Reply

    Bryan Shanaver 8 months agoThanks for posting - worked for me too

    Reply

    RamiJames 8 months agoThank you for posting this answer!

    Reply

    Nathan Bashaw 9 months agoThank you soooo much!!!!

    Reply

    Amicushq.com 9 months agoThis was amazing! Thank you so much!!

    Reply

    narangjasdeep 9 months agoMod Amicushq.comGlad it helped.

    WHAT'S THIS?

    Share

    Share

    Share

    Share

    Share