Installing Nokogiri Fails on OS X Mavericks


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

After seeing this error, I was pretty much like:


So, i checked the gem_make.out where the errors were logged and figured my comman line developer tools in this new version of OS X were pooched/missing. There is a command line tool available called xcode-select which is used 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:

Screen Shot 2013-10-28 at 12.07.51 PMScreen Shot 2013-10-28 at 11.16.43 AM


After downloading and installing the new Command Line Developer Tools:


If this didn’t worked for you, a couple people reported that their gcc was missing. Consider following this Stack Overflow question if that’s the case:

PS: I had a few warnings after installing the gem which I’ve left out for brevity sake. These were just some encoding warnings – Nothing serious. I’m hoping there won’t be any major issues  with Nokogiri on Mavericks.


    This was amazing! Thank you so much!!

    • narangjasdeep

      Glad it helped.

  • narangjasdeep

    Glad it helped.

  • Nathan Bashaw

    Thank you soooo much!!!!

  • RamiJames

    Thank you for posting this answer!

  • Bryan Shanaver

    Thanks for posting – worked for me too

  • mgryszko

    Thanks for the tip – it worked like a charm!

    • narangjasdeep

      glad I could be helpful. keep coding! 😉

  • Rob Park

    Worked for me too. Thanks!

    • narangjasdeep

      ApproveSent from my iPhone

  • Gourav Tiwari

    this worked! thanks for sharing!

    • narangjasdeep

      approveSent from my iPhone

  • spencer owen

    Unfortunately it didn’t work for me because of this

    • narangjasdeep

      thanks for posting this link to SO, I hope it turns out to be helpful for others.

  • grimmdude

    Thanks man, exactly what I was looking for!

    • narangjasdeep

      sorry for the late reply, but glad this was helpful!

  • sally

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

  • Joel

    “Can’t install the software because it is not currently available from the Software Update server.” See this message consistently.

    • narangjasdeep

      Unsure what’s going on. At what step do you get this?

  • Rafael Rosa

    Thanks, it worked 🙂

    • narangjasdeep

      glad it helped. Thanks!

  • Chandler Roth

    I could hug you. Worked like a dream. Thanks.

  • Alex Jahraus

    Thanks a lot! Installing XCode CL tools fixed this for me, however, I was unable to install them using xcode-select --install, had to download the DMG from Apple:

  • wanlin brian

    Thanks a lot!

  • Arpan J

    This worked! Was trying to solve this for a while. Thanks much!!

  • Guest

    this worked, after struggling with the nokogiri install

  • erwin

    unfortunatly, new major issues with Nokogiri on Mavericks…. seems to be the case with each new XCode release now …

  • yinghau76

    You save my day. Thank you!

  • Alex

    Thank you sir!

  • Jeff Kibuule


  • kennygorman

    Thx!!! helped a ton.

  • Stephen Benner

    For those having issues related to creating the native extensions (libiconv especially) I’d like to share a Ruby script that acts as a self-contained solution and should work on any recent Mac OS X / Homebrew installations. It can configure and install using Bundler if you want–see the gist for details.

  • Emrul

    Thank you…!!!

  • Fernando Henrique

    Worked!!! Haleluuiah!

  • alightholder

    Dude you just saved my sanity. Thank you for writing this

  • Tony


  • 卢 浩钊

    it helped, thanks.