media-scientific - IT Blog

the backend developers blog

ERROR: Error installing nokogiri:

Vorlesen mit webReader

Die Installation des gem nokogiri auf einem Linux (Debian/ Ubuntu), kann einen in den Wahnsinn trieben. Die folgende Fehlermeldung erscheint wahrscheinlich bei den meisten:

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

/usr/bin/ruby1.8 extconf.rb install nokogiri
checking for #include <iconv.h>
… yes
checking for #include <libxml/parser.h>
… yes
checking for #include <libxslt/xslt.h>
… no
libxslt is missing.  try ‘port install libxslt’ or ‘yum install libxslt-devel’
*** 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=/usr/bin/ruby1.8
	–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

Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/nokogiri-1.3.1 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/nokogiri-1.3.1/ext/nokogiri/gem_make.out

Nokogiri benötigt auf Debian-Derivaten die folgenden Pakete:

  • libxml2-dev
  • libxslt1-dev
sudo apt-get install libxml2-dev libxslt1-dev

installiert diese.

Eine anschließende Installation sollte keine Probleme mehr bereiten:

$ gem install nokogiri
Building native extensions.  This could take a while...
Successfully installed nokogiri-1.3.1
1 gem installed
Installing ri documentation for nokogiri-1.3.1...
Installing RDoc documentation for nokogiri-1.3.1...

 				

Leave a Reply

You must be logged in to post a comment.