我试图安装Nokogiri,但我总是得到一个编译错误:
checking for libxml/parser.h... *** extconf.rb failed ***
但是,我已经安装了它和所有其他依赖项。
我试着给安装程序这样的提示:
%> gem install nokogiri -- --with-xml2-lib=/usr/lib/ --with-xml2-include=/usr/include/libxml2/
...
checking for libxml/parser.h... *** extconf.rb failed ***
...
但是它仍然没有安装:
%> find /usr/include/ -name "parser.h"
/usr/include/libxml2/libxml/parser.h
...
我用的是Ubuntu 11.10
输出:
"dpkg-query -l | grep xml
“和"dpkg-query -l | grep xslt
”
失败似乎是站在了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
发布于 2012-09-12 00:45:19
这将会起作用。
sudo apt-get install libxslt-dev libxml2-dev
gem install nokogiri
发布于 2015-04-13 19:49:17
我刚刚在(cat /etc/centos-release
:) CentOS release 6.6 (最终版)上遇到了同样的问题。
sudo yum install -y rubygem-nokogiri
…修复了这个问题。
(请参阅:http://www.nokogiri.org/tutorials/installing_nokogiri.html#red_hat___centos)
https://stackoverflow.com/questions/9590038
复制相似问题