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
gem update --system xcode-select --install brew unlink xz gem install nokogiri -v '1.6.8.1' brew link xz
If the above steps fail to fix the issue, what has also worked for me is running brew doctor and cleaning up any unbrewed header files.
brew doctor