我正在尝试安装hpricot,但得到了以下错误。我确实安装了xcode,但我不确定还遗漏了什么。
$ gem install hpricot
Building native extensions. This could take a while...
ERROR: Error installing hpricot:
ERROR: Failed to build gem native extension.
/Users/user_name/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for stdio.h... *** 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.我也试过nokogiri。
$ gem install nokogiri
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/Users/user_name/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for libxml/parser.h... *** 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.发布于 2012-07-23 09:30:58
我不认为hpricot已经被支持了。你应该研究一下nokogiri,它的速度要快得多,而且有非常好的文档。
编辑:我刚刚查看了hpricot github页面(https://github.com/hpricot/hpricot/),他们还建议你使用nokogiri:
Hpricot已结束。请考虑一下像nokogiri这样的替代品。
edit#2:如果您在安装它时遇到错误,很可能是因为您缺少libxml和其他需要通过自制软件或macport安装的库。所有必需的库和安装说明都可以在以下位置找到:
http://nokogiri.org/tutorials/installing_nokogiri.html
发布于 2012-07-23 09:48:10
根据nokogiri构建中的错误消息,您似乎没有libxml或libxml开发库。
发布于 2014-05-13 06:50:31
使用Kubuntu 14.04我安装了hpricot (在出现错误" error : Failed to build gem native extension“之后。)只需先安装ruby-dev即可。
https://stackoverflow.com/questions/11605404
复制相似问题