title: Why does installing Nokogiri on Mac OS fail with libiconv is missing?
body: <p>I've been trying to install Nokogiri on Mac OS 10.9.3 and whatever I try, the install fails in the end with the following error message:</p>
  
  <pre><code>$ sudo gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.9.1/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.1/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28 --with-iconv-include=/usr/local/Cellar/libiconv/1.14/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.14/lib
  Building native extensions with: '--with-xml2-include=/usr/local/Cellar/libxml2/2.9.1/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.1/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28 --with-iconv-include=/usr/local/Cellar/libiconv/1.14/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.14/lib'
  This could take a while...
  Building nokogiri using packaged libraries.
  ERROR:  Error installing nokogiri:
      ERROR: Failed to build gem native extension.
  
      /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb --with-xml2-include=/usr/local/Cellar/libxml2/2.9.1/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.1/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28 --with-iconv-include=/usr/local/Cellar/libiconv/1.14/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.14/lib
  Building nokogiri using packaged libraries.
  checking for iconv.h... yes
  checking for iconv_open() in iconv.h... no
  checking for iconv_open() in -liconv... no
  checking for libiconv_open() in iconv.h... no
  checking for libiconv_open() in -liconv... no
  -----
  libiconv is missing.  please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
  -----
  *** extconf.rb failed ***
  Could not create Makefile due to some reason, probably lack of necessary
  libraries and/or headers.  Check the mkmf.log file for more details.  You may
  need configuration options.
  
  Provided configuration options:
      --with-opt-dir
      --without-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
      --srcdir=.
      --curdir
      --ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
      --help
      --clean
      --use-system-libraries
      --enable-static
      --disable-static
      --with-zlib-dir
      --without-zlib-dir
      --with-zlib-include
      --without-zlib-include=${zlib-dir}/include
      --with-zlib-lib
      --without-zlib-lib=${zlib-dir}/lib
      --enable-cross-build
      --disable-cross-build
  
  
  Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.2.1 for inspection.
  Results logged to /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.2.1/ext/nokogiri/gem_make.out
  </code></pre>
  
  <p>After following a lot of help found around the web including building and installing libxml2 and libxslt using brew and building libiconv from the sources (as described in "<a href="http://nokogiri.org/tutorials/installing_nokogiri.html" rel="noreferrer">Installing Nokogiri</a>"), the error remains the same. </p>
  
  <p>When trying to run the installation for Nokogiri, libxml2 and libxslt seem to be found fine, but not libiconv.</p>
  
  <p>Anyone with a better knowledge of these things know how to get Nokogiri installed?</p>