What is the reliable installation process for Nokogiri (on Ubuntu)?

I tried installing Nokogiri on my Ubuntu 12.04 system and received the error message " libxslt is missing ", but libxslt-dev and libxml2-dev installed.

Is there a reliable installation process? How to check links to dependent libraries?

I used RVM and also installed RVM pkg.

 ERROR: Error installing nokogiri: ERROR: Failed to build gem native extension. /home/victor/.rvm/rubies/ruby-1.9.3-p125/bin/ruby extconf.rb 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... 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. ----- *** 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 --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/victor/.rvm/rubies/ruby-1.9.3-p125/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 --with-xml2lib --without-xml2lib --with-xsltlib --without-xsltlib Gem files will remain installed in /home/victor/.rvm/gems/ruby-1.9.3-p125@dradis/gems/nokogiri-1.5.4 for inspection. Results logged to /home/victor/.rvm/gems/ruby-1.9.3-p125@dradis/gems/nokogiri-1.5.4/ext/nokogiri/gem_make.out enter code here 
+7
ruby ubuntu nokogiri
source share
5 answers

I also had the same problem with rvm, although I did the following according to the documentation:

  • sudo apt-get install libxslt-dev libxml2-dev
  • rvm pkg libxml2 and rvm pkg libxslt

The only way I could solve this problem was after a lengthy investigation:

  • Remove ruby ​​installation: rvm remove 1.9.3
  • Remove all libxslt* and libxml2* libs from ~/.rvm/usr/lib if you previously did rvm pkg ...
  • Reinstall ruby: rvm install 1.9.3

Reinstalling after apt-get commands seems to be the only way to get this to work. It also provides support for libs installed using rvm pkg dont intere.

When all else fails ...

If all else fails and you absolutely need the installed pearls, you can also rebuild nokogiri by applying a simple patch - provided that you have all the build tools, and with the caution that this will install the latest and potentially unstable code:

  • git clone git://github.com/sparklemotion/nokogiri
  • get the patch from this value and save it as x86_64.patch in the nokogiri folder.
  • Apply patch: patch -p1 < x86_64.patch
  • Rebuild: rake native gem - this should build a gem in the pkg/ folder
  • Install the gem using gem install pkg/nokogiri-<version>-x86_64-linux.gem
+7
source share

I'm new to ruby, but that ...

 gem install nokogiri -v '1.5.2' -- --with-xml2-lib=/usr/lib/i386-linux-gnu --with-xml2-include=/usr/include/libxml2 --with-xslt-lib=/usr/lib/i386-linux-gnu --with-xslt-include=/usr/include/libxslt 

... worked for me on Ubuntu 12.04. (Or, in any case, he satisfied the nokogiri addiction and brought me one step closer to what I'm really trying to accomplish.) I thought this could ruin my RVM magic, but nokogirl-1.5.2 definitely sits there in ~ /.rvm/ruby-1.9.3-p194/gems, so ... maybe all this is good?

0
source share

I had a problem with Ubuntu 13.04.

I tried everything that you found everywhere on the Internet. Make sure the packages listed on the Nokogiri installation page are present, etc. Etc.

The only thing that eventually did this for me was to install libsxlt from the source. After that, everything worked perfectly.

0
source share

I had to use gem install nokogiri - --with-iconv-dir = / usr / lib / ruby ​​/1.9.1/x86_64-linux

0
source share
 sudo apt-get install ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8 sudo apt-get install libreadline-ruby1.8 libruby1.8 libopenssl-ruby sudo apt-get install libxslt-dev libxml2-dev 

?

-one
source share

All Articles