• Fix nokogiri install issue on Mac OS X 10.9

When installing nokogiri 1.6.1 on my RubyStack installation with Mac OS X Mavericks I got the following error.

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

Running ‘configure’ for libxml2 2.8.0… ERROR, review ‘tmp//ports/libxml2/2.8.0/configure.log’ to see what happened.

The configure.log said that the gcc/make could not be found. While figuring it out I found a lot of issues, and the information for fixing them was all deprecated.

The following steps solved my issues completely:

# sudo xcode-select -switch /Library/Developer/CommandLineTools
# gem uninstall nokogiri libxml-ruby
# gem update --system
# gem install nokogiri

Gem update is unnecessary, but good to have just in case. Hope this helps.

The Author

Dan Schultzer is an active experienced entrepreneur, starting the Being Proactive groups, Dream Conception organization, among other things. You can find him at twitter

Like this post? More from Dan Schultzer

Comments? We would love to hear from you, write us at @dreamconception.