我正在尝试安装nokogiri版本1.6.0,并且有一些问题。
$ gem install nokogiri -v '1.6.0' -- --with-xml2-dir=/usr/local/Cellar/libxml2/2.9.1 --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28
Building native extensions with: '--with-xml2-dir=/usr/local/Cellar/libxml2/2.9.1 --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28'
This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/Users/shamatov/.rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb --with-xml2-dir=/usr/local/Cellar/libxml2/2.9.1 --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28
Extracting libxml2-2.8.0.tar.gz into tmp/i686-apple-darwin11/ports/libxml2/2.8.0... OK
Running 'configure' for libxml2 2.8.0... OK
Running 'compile' for libxml2 2.8.0... OK
Running 'install' for libxml2 2.8.0... OK
Activating libxml2 2.8.0 (from /Users/shamatov/.rvm/gems/ruby-1.9.3-p448/gems/nokogiri-1.6.0/ports/i686-apple-darwin11/libxml2/2.8.0)...
Extracting libxslt-1.1.26.tar.gz into tmp/i686-apple-darwin11/ports/libxslt/1.1.26... OK
Running 'configure' for libxslt 1.1.26... OK
Running 'compile' for libxslt 1.1.26... OK
Running 'install' for libxslt 1.1.26... OK
Activating libxslt 1.1.26 (from /Users/shamatov/.rvm/gems/ruby-1.9.3-p448/gems/nokogiri-1.6.0/ports/i686-apple-darwin11/libxslt/1.1.26)...
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.
如您所见,我使用:--with-xml2-dir=/usr/local/Cellar/libxml2/2.9.1 --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28
但extconf.rb使用libxml2-2.8.0.tar.gz与xslt相同,它使用libxslt-1.1.26.tar.gz
如何解决此问题,实际上导致无法更改版本?谢谢
尝试:
$ gem uninstall nokogiri # JIC
$ NOKOGIRI_USE_SYSTEM_LIBRARIES=1 gem install nokogiri \
-- --use-system-libraries \
--with-iconv-dir="$(brew --prefix libiconv)" \
--with-xml2-config="$(brew --prefix libxml2)/bin/xml2-config" \
--with-xslt-config="$(brew --prefix libxslt)/bin/xslt-config"
希望能帮助到你。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句