我在这个宝石上遇到了很多问题,所以我读到我不得不使用de 1.5.0-beta。
由于我使用的是windows,所以我下载了DevKit。但当我跑步时:
gem安装nokogiri--预安装--带有-xml2-lib--带有xslt-lib
我得到:
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
C:/Ruby187/bin/ruby.exe extconf.rb --with-xml2-lib --with-xslt-lib --pla
taform=ruby
*** 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:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby187/bin/ruby
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--with-iconv-dir
--without-iconv-dir
--with-iconv-include
--without-iconv-include=${iconv-dir}/include
--with-iconv-lib
--without-iconv-lib=${iconv-dir}/lib
--with-xml2-dir
--without-xml2-dir
--with-xml2-include
--without-xml2-include=${xml2-dir}/include
--with-xml2-lib=${xml2-dir}/lib
C:/Ruby187/lib/ruby/1.8/mkmf.rb:1177:in `dir_config': private method `split' cal
led for true:TrueClass (NoMethodError)
from extconf.rb:87
Gem files will remain installed in C:/Ruby187/lib/ruby/gems/1.8/gems/nokogiri-1.
5.0.beta.4 for inspection.
Results logged to C:/Ruby187/lib/ruby/gems/1.8/gems/nokogiri-1.5.0.beta.4/ext/no
kogiri/gem_make.out
我能做什么?
使用类似的命令
gem install nokogiri --pre -- --with-xml2-lib --with-xslt-lib
看起来你正在尝试安装最新版本的nokogiri。尝试使用--version
指定精确的版本。
还应注意以下对nokogiri 1.6+的要求
- ruby 1.9.3或更高版本
- 在Nokogiri 1.6.0及更高版本中,不再需要libxml2和libxslt
因此,如果您确实想使用ruby 1.8.7(即EOL,btw),那么,是的,您确实需要指定nokogiri<1.6.然而,如果你能使用一个现代的、活的ruby,那么你可能会避开lib依赖关系。