我试图安装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
”
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
失败似乎在海湾合作委员会的一边:
%> 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
解决方法
这将工作.
sudo apt-get install libxslt-dev libxml2-dev gem install nokogiri