If you’re a rails developer, I’m pretty sure you have already found this image below…
Most of the cases, that happens because nokogiri depends on libxml2 and it’s probably not finding it. There are thousand options that you can give before installing like this list:
Here is what is going to save your life :-) That usually works for me!
If it still does not work, you can try a few different things - assuming you’re on a mac.
And hope to see…
PS. Remember that you can always pass the exact version you’re a looking for with -v '1.6.6.4'