libxslt is missing while installing ruby gem nokogiri

first make sure you have all the dependencies, as mentioned in "Installing Nokogiri with RVM on Ubuntu" (which mentions the very same error message)

I have no idea why it can't find the package "libxslt". Instead of worrying about that, I'm going to install the dependencies listed on Nokogiri GitHub page:

$ sudo apt-get install libxslt-dev libxml2-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libxslt1-dev' instead of 'libxslt-dev'
libxslt1-dev is already the newest version.
libxml2-dev is already the newest version.

That appears to have worked well enough, so I press on. The next step is install the actual Nokogiri gem. The instructions say to use "sudo gem install nokogiri", but because I'm using RVM, I drop the "sudo" part:

$ gem install nokogiri

Considering "Fresh install of RVM in Ubuntu isn't letting me install gems (zlib error)", since you have libxslt1-dev (and not libxslt-dev), you might considering recompiling your ruby.
(a bit like in "How to get Readline support in IRB using RVM on Ubuntu 11.10")


Try Nokogiri 1.6.0.rc1, which bundles libxml2 and libxslt in the gem. This should address your installation problem:

gem install nokogiri --pre

should do the trick.