Last Updated: February 25, 2016
· devatotech
Avatar square

Nokogiri Install Error - libiconv is missing

Started getting this error everytime we installed a new Ruby version:
An error occurred while installing nokogiri (, and Bundler cannot continue.
Make sure that gem install nokogiri -v '' succeeds before bundling.

After scrolling up you see that liviconv is missing.

Try these steps to correct:
brew update

Then install a newer version of libiconv:
brew install libiconv

Then link your new iconv libs:
brew link libiconv

After running the above command, tank note of where libiconv is stored
Warning: Already linked: /usr/local/Cellar/libiconv/1.14

Then install your gem:
gem install nokogiri -- --with-iconv-dir=/usr/local/Cellar/libiconv/1.14

Say Thanks
Filed Under