Install problems: Nokogiri on Mac OSx Mountain Lion <p>For some reason I cannot install Nokogiri on my MacBook for traveling.</p> <p>This is short output from <code>gem install nokogiri</code>:</p> <pre><code>Extracting libxml2-2.8.0.tar.gz into tmp/x86_64-apple-darwin12/ports/libxml2/2.8.0... OK Running 'configure' for libxml2 2.8.0... OK Running 'compile' for libxml2 2.8.0... OK Running 'install' for libxml2 2.8.0... OK Activating libxml2 2.8.0 (from /Users/jseidel/.rvm/gems/ruby-1.9.3-p327@rails3213/gems/nokogiri-1.6.0/ports/x86_64-apple-darwin12/libxml2/2.8.0)... Extracting libxslt-1.1.26.tar.gz into tmp/x86_64-apple-darwin12/ports/libxslt/1.1.26... OK Running 'configure' for libxslt 1.1.26... OK Running 'compile' for libxslt 1.1.26... OK Running 'install' for libxslt 1.1.26... OK Activating libxslt 1.1.26 (from /Users/jseidel/.rvm/gems/ruby-1.9.3-p327@rails3213/gems/nokogiri-1.6.0/ports/x86_64-apple-darwin12/libxslt/1.1.26)... 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... yes checking for xmlParseDoc() in -lxml2... no ----- libxml2 is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies. </code></pre> <p>However, I used MacPorts and it says that it's already installed:</p> <pre><code>port installed | grep lib libxml @1.8.17_0 (active) libxml2 @2.9.1_0 (active) </code></pre> <p>Is it getting confused because both libxml and libxml2 are installed? (Probably not.) Or is there something else going on?</p> <p>I've followed the installation instructions for Nokigiri installation and that doesn't help.</p> <p>Finally, I uninstalled ports libxml and libxml2 and now it fails attempting to use libiconv, having gotten past the previous XML issue it seems.</p>