Thanks to a gist (which I forked and slightly changed) I was able to finally install Nokogiri on my mac:
export BREW_HOME=/usr/local
brew install libxml2brew link libxml2brew install https://github.com/adamv/homebrew-alt/raw/master/duplicates/libxslt.rbbrew link libxsltbrew install libiconvbrew link libiconvgem install nokogiri -- --with-xml2-dir=$BREW_HOME/Cellar/libxml2/2.7.8 --with-xslt-dir=$BREW_HOME/Cellar/libxslt/1.1.26 --with-iconv-dir=$BREW_HOME/Cellar/libiconv/1.13.1/If you had MacPorts previously installed, it might still not work so
sudo mv /opt/local /opt/local_old
and try again.
Enjoy
