Skip to main content

Posts

Showing posts from July, 2011

Ruby, Mac Ports and OS-X Lion

Today I upgraded my work machine to OS-X Lion. As I do ruby development on my machine, I quickly stumbled upon a problem with installing "nokogiri" gem. I was getting this error:

Installing nokogiri (1.5.0) with native extensions [snip] `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) /Users/kig/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb checking for libxml/parser.h... *** extconf.rb failed ***
In addition to installing new XCode from the app store, I also have Mac Ports installed, and so I had to perform the following command to allow nokogiri to build:
sudo port upgrade libxml2 libxslt

After this command completed, Nokogiri happily found libxml and it's dependencies.

UPDATE: Note that I no longer recommend installing libxml2 via ports. Use brew + rbenv instead.