【发布时间】:2010-08-13 22:51:37
【问题描述】:
尝试安装 gem,但找不到标头,尽管指定了标头:
sudo gem install nokogiri -- --with-xml2-lib=/usr/local/lib --with-xml2-include=/usr/local/include/libxml2 --with-xml2-include=/usr/local/include/libxml2 --with-xslt-include=/usr/local/include/libxslt
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb --with-xml2-lib=/usr/local/lib --with-xml2-include=/usr/local/include/libxml2 --with-xml2-include=/usr/local/include/libxml2 --with-xslt-include=/usr/local/include/libxslt
checking for #include <libxml/parser.h>
... no
-----
libxml2 is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
/usr/local/include/libxml2/libxml/parser.h 文件确实存在,所以我不明白为什么这不起作用。
编辑:我在 Centos 5.4
【问题讨论】:
-
在没有所有这些选项的情况下安装会发生什么?
-
实际上发生了同样的事情。我是从源代码安装的,最后我确实做了
sudo make install,通过在相应目录中存在已编译的二进制文件来确认。
标签: c ruby rubygems compilation