I know there are a lot of questions about this gem but no answer has worked for me.
When I run in SSH gem install nokogiri I get this error:
<
Finally after much struggle the following worked for me (OS X 10.8.5, macports). (I am installing github pages i.e. jekyll)
/opt/local/bin/gem install nokogiri -v 1.6.6.2 -- --use-system-libraries --with-xslt-dir=/usr/local/opt/libxslt --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/libxml2 --with-xml2-lib=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib