I\'m having troubles installing Nokogiri (1.6.8.1) on Mac OS Sierra 10.12.
I tried using brew install libxml2 libxslt and then referencing the install direc
brew install libxml2 libxslt
Similar to yuяi's answer and from Nokogiri's help:
brew unlink xz gem install nokogiri brew link xz
http://www.nokogiri.org/tutorials/installing_nokogiri.html#mac_os_x
This worked for 1.7.0.1