Error installing nokogiri in ubuntu 14.0.4 (Ruby 1.8.7)

I tried the following commands and I've got it. Thanks to Mr.Kumar

$ sudo apt-get update 
$ sudo apt-get install libxml2-dev
$ sudo apt-get install libxslt-dev
$ sudo gem install nokogiri -v '1.4.7'

$ gem list nokogiri
*** LOCAL GEMS ***
nokogiri (1.4.7)

First, update the package index (package list).

sudo apt-get update 

Install libxml2.

sudo apt-get install libxml2-dev

After doing everything above and still getting the error what worked for me using bundle config build with the system libraries:

bundle config build.nokogiri --use-system-libraries
bundle install

Hope it helps! :)


in my case i need to install also this library. $ sudo apt-get install zlib1g-dev