I tried to install Nokogiri but I always get an compiling error:
checking for libxml/parser.h... *** extconf.rb failed ***
but, I've installed it and all other dependencies.
I try to give the installer hints like this:
%> gem install nokogiri -- --with-xml2-lib=/usr/lib/ --with-xml2-include=/usr/include/libxml2/
...
checking for libxml/parser.h... *** extconf.rb failed ***
...
but it still doesn't install:
%> find /usr/include/ -name "parser.h"
/usr/include/libxml2/libxml/parser.h
...
I'm on Ubuntu 11.10.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Output of:
"dpkg-query -l | grep xml
" and "dpkg-query -l | grep xslt
"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The failure seem to be on the side of GCC:
%> cat hello.c
#include <stdio.h>
main()
{
printf("Hello World \n");
}
%> gcc hello.c
/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x12): undefined reference to `__libc_csu_fini'
/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x19): undefined reference to `__libc_csu_init'
collect2: ld gab 1 als Ende-Status zurück
If you find any file or directory with the substring libxml2 in /usr/local/include or /usr/local/lib (such as /usr/local/lib/libxml2.so ) then it is already installed.
Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby. It provides a sensible, easy-to-understand API for reading, writing, modifying, and querying documents. It is fast and standards-compliant by relying on native parsers like libxml2 (C) and xerces (Java).
This will work.
sudo apt-get install libxslt-dev libxml2-dev
gem install nokogiri
I just faced the same issue on (cat /etc/centos-release
:) CentOS release 6.6 (Final).
sudo yum install -y rubygem-nokogiri
…fixed that problem.
(see: http://www.nokogiri.org/tutorials/installing_nokogiri.html#red_hat___centos)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With