I\'m trying to install nokogiri on my machine but I am receiving the following error:
Building native extensions. This could take a while...
ERROR: Error
After combining many solutions from git issues and SO, this worked for me:
gem install nokogiri -v '1.6.7' -n /usr/local/bin -- --use-system-libraries --with-xml2-include=/usr/include/libxml2 --with-xml2-lib=/usr/lib/
Although I did prepend sudo
.
This seems to be a common issue. You can check the following link
http://www.nokogiri.org/tutorials/installing_nokogiri.html
You will need to update the Rubygems to 2.4.5 or later and also check whether development tools is installed on you pc.
Or you can do the following if you are using bundle
gem update --system
gem install nokogiri -- --use-system-libraries
bundle config build.nokogiri --use-system-libraries
bundle install
I had to use version 1.6.7.rc4-x64-mingw32 (I'm on Windows). Added this line to my Gemfile:
gem 'nokogiri', '~> 1.6', '>= 1.6.7.rc4'