Nokogiri libxml and libxslt dependency does not install

I am using Ruby 2.1 on Ubuntu 12.10 64bit. I cannot install Nokogiri because it needs libXSLT and libxml. I tried to install these two but got this error:

***@***:~$ sudo apt-get install libxslt-dev libxml2-dev
[sudo] password for : 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libxslt1-dev' instead of 'libxslt-dev'
libxml2-dev is already the newest version.
The following NEW packages will be installed:
  libxslt1-dev
0 upgraded, 1 newly installed, 0 to remove and 5 not upgraded.
Need to get 578 kB of archives.
After this operation, 2,422 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
WARNING: **The following packages cannot be authenticated!**
  libxslt1-dev
Install these packages without verification [y/N]? y
Err http://security.ubuntu.com/ubuntu/ quantal-security/main libxslt1-dev amd64 1.1.26-14ubuntu0.1
  404  Not Found [IP: 91.189.91.13 80]
Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/libx/libxslt/libxslt1-dev_1.1.26-14ubuntu0.1_amd64.deb  404  Not Found [IP: 91.189.91.13 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing

      

I also tried adding security updates for 12.04, but that chance also failed.

I ran sudo apt-get update

, but the problem still persists.

When I run bundle install

or gem install nokogiri

, I get the following error:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

  /home/####/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb 
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... no
-----
libxslt is missing.  please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
  --with-opt-dir
  --without-opt-dir
  --with-opt-include
  --without-opt-include=${opt-dir}/include
  --with-opt-lib
  --without-opt-lib=${opt-dir}/lib
  --with-make-prog
  --without-make-prog
  --srcdir=.
  --curdir
  --ruby=/home/kamal/.rvm/rubies/ruby-2.1.0/bin/ruby
  --with-zlib-dir
  --without-zlib-dir
  --with-zlib-include
  --without-zlib-include=${zlib-dir}/include
  --with-zlib-lib
  --without-zlib-lib=${zlib-dir}/lib
  --with-iconv-dir
  --without-iconv-dir
  --with-iconv-include
  --without-iconv-include=${iconv-dir}/include
  --with-iconv-lib
  --without-iconv-lib=${iconv-dir}/lib
  --with-xml2-dir
  --without-xml2-dir
  --with-xml2-include
  --without-xml2-include=${xml2-dir}/include
  --with-xml2-lib
  --without-xml2-lib=${xml2-dir}/lib
  --with-xslt-dir
  --without-xslt-dir
  --with-xslt-include
  --without-xslt-include=${xslt-dir}/include
  --with-xslt-lib
  --without-xslt-lib=${xslt-dir}/lib
  --with-libxslt-config
  --without-libxslt-config
  --with-pkg-config
  --without-pkg-config
  --with-libxml-2.0-config
  --without-libxml-2.0-config
  --with-libiconv-config
  --without-libiconv-config

extconf failed, exit code 1

Gem files will remain installed in /home/kamal/.rvm/gems/ruby-2.1.0@xxx/gems/nokogiri-1.5.11 for inspection.
Results logged to /home/****/.rvm/gems/ruby-2.1.0@project-trave/extensions/x86_64-linux/2.1.0/nokogiri-1.5.11/gem_make.out
An error occurred while installing nokogiri (1.5.11), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.5.11'` succeeds before bundling.

      

+3


source to share


1 answer


Try the following:

sudo apt-get install libxslt-dev libxml2-dev zlib1g-dev
sudo gem install nokogiri

      



You need to have all the required libraries installed on your computer. When you installed RVM, it should have pointed this out for you. In the current version of rvm, you can run rvm requirements

to see the exact list. Hope this can help you.

+9


source







All Articles