I\'ve tried to install Nokogiri 1.6.1 under Ruby and RVM but is failing with the following error:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build
manually ./configure 'include' and 'lib' locations helped me out. libxml2 source layout is a bit strange, so i ended up with alike options:
gem install nokogiri -- --use-system-libraries --with-xslt-dir=/usr/local/opt/libxslt --with-xml2-include=/usr/local/Cellar/libxml2/2.9.1/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.1/lib
of course, version numbers depend upon what is actually installed. at the time of this writing there version were in the brew.
in my case /usr/local/Cellar/libxml2/2.9.1/include/libxml2 contains a single directory named libxml and /usr/local/Cellar/libxml2/2.9.1/lib contains libxml2.2.dylib libxml2.a libxml2.dylib pkgconfig xml2Conf.sh: these are what the script is looking for, no other combination made it compile using system libraries.
using homebrew nokogiri can be installed with neither outdated nor incompatible (recent) libxml2 and libxslt libraries as pointed out in this gist. working fine and fast for me.