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:
<
Nothing in current answers worked for me (I use Ubuntu 16.04, not Mac).
However, by following the instructions in Nokogiri site and this part did the trick:
# See http://www.nokogiri.org/tutorials/installing_nokogiri.html#ubuntu___debian
sudo apt-get install build-essential patch
sudo apt-get install ruby-dev zlib1g-dev liblzma-dev
Note I've been using Nokogiri since 2009 and I've always had trouble installing it. Any further comment would probably not comply with SO T&Cs :)