Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unable to install nokogiri in ubuntu 12.04

I am trying to setup rails env on my new ubuntu machine. But I am facing trouble while install nokogiri gem.. I have installed libxslt and libxml2 libs thourgh rvm pkg command as well as using apt-get. I thought it is showing me libxslt is missing error.

Building native extensions.  This could take a while...
ERROR:  Error installing nokogiri:
    ERROR: Failed to build gem native extension.

        /home/hacker5/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb --with-xslt-include=/usr/include/libxslt
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... yes
checking for libexslt/exslt.h... yes
checking for iconv_open() in iconv.h... no
checking for iconv_open() in -liconv... yes
checking for xmlParseDoc() in -lxml2... yes
checking for xsltParseStylesheetDoc() in -lxslt... no
-----
libxslt is missing.  please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----

EDIT

I am using rvm setup and ruby 1.9.3

like image 573
Hardik Joshi Avatar asked Jul 26 '12 06:07

Hardik Joshi


2 Answers

Try this:

# nokogiri requirements
sudo apt-get install libxslt-dev libxml2-dev
gem install nokogiri
like image 133
Benjamin Tan Wei Hao Avatar answered Nov 18 '22 03:11

Benjamin Tan Wei Hao


For Ruby 1.9.3 and 2.0, libxslt-dev and libxml2-dev are required.

sudo apt-get install libxslt-dev libxml2-dev

like image 10
rdsoze Avatar answered Nov 18 '22 05:11

rdsoze