真的很快,我知道similar question。但是,遵循最高评级的答案是行不通的。我已经重启了我的系统和终端,但无济于事。
出于某种原因,Nokogiri并不认识我安装了libxslt1-dev
,虽然我明确安装了sudo apt-get install libxslt-dev
和sudo apt-get install libxslt1-dev
。
这是输出;我错过了什么吗?
$ gem install nokogiri -v '1.5.2'
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
~/.rvm/rubies/ruby-1.9.3-p125/bin/ruby extconf.rb
extconf.rb:10: Use RbConfig instead of obsolete and deprecated Config.
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... yes
checking for libexslt/exslt.h... yes
checking for iconv_open() in iconv.h... no
checking for iconv_open() in -liconv... yes
checking for xmlParseDoc() in -lxml2... yes
checking for xsltParseStylesheetDoc() in -lxslt... no
-----
libxslt is missing. please visit
http://nokogiri.org/tutorials/installing_nokogiri.html for help
with installing dependencies.
-----
*** 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.
Provided configuration options:
List of options
Gem files will remain installed in ~/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/nokogiri-1.5.2 for inspection.
Results logged to ~/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/nokogiri-1.5.2/ext/nokogiri/gem_make.out
编辑:经过仔细检查,我意识到安装程序会识别出我已经安装了libxslt1-dev
,但它没有通过其中一项测试。我是否在安装时出错了?
编辑2 :我正在尝试使用capybara
安装bundle install
,在其多个依赖项中,nokogiri
和selenium-webdriver
找不到{ {1}},因此我无法使用libxslt
。
编辑3:以下是来自capybara
文件的错误消息;如果你需要其余部分,请告诉我。
mkmf.log
答案 0 :(得分:3)
您似乎安装了多个libxml2
(可能还有libxslt
)副本,并且它们互相混淆。尝试从系统中搜索并删除这些库(及其包含文件)的任何额外副本。
答案 1 :(得分:0)
尝试一些想法: