gpt4 book ai didi

ruby - gem install nokogiri -v '1.6.3.1' on OS X 10.10 Yosemite 未安装

转载 作者:太空宇宙 更新时间:2023-11-03 17:01:30 26 4
gpt4 key购买 nike

更新到 OS X 10.10 Yosemite 后我无法安装 nokogiri (1.6.3.1)

> bundle

Building nokogiri using packaged libraries.

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/Users/ju/.rvm/rubies/ruby-2.1.2/bin/ruby extconf.rb
Building nokogiri using packaged libraries.
-----
libiconv 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:
--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=/Users/ju/.rvm/rubies/ruby-2.1.2/bin/ruby
--help
--clean
--use-system-libraries
--enable-static
--disable-static
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--enable-cross-build
--disable-cross-build

extconf failed, exit code 1

Gem files will remain installed in /Users/ju/.rvm/gems/ruby-2.1.2@sumup/gems/nokogiri-1.6.3.1 for inspection.
Results logged to /Users/ju/.rvm/gems/ruby-2.1.2@sumup/extensions/x86_64-darwin-13/2.1.0-static/nokogiri-1.6.3.1/gem_make.out
An error occurred while installing nokogiri (1.6.3.1), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.3.1'` succeeds before bundling.

最佳答案

> brew update
> brew install libxml2 libxslt libiconv

> brew --prefix libxml2
/usr/local/opt/libxml2

> brew --prefix libxslt
/usr/local/opt/libxslt

> brew --prefix libiconv
/usr/local/opt/libiconv

> gem uninstall nokogiri

> gem install nokogiri -v 1.6.3.1 -- --with-xslt-dir=/usr/local/opt/libxslt --with-iconv-dir=/usr/local/opt/libiconv --with-xml2-config=/usr/local/opt/libxml2/bin/xml2-config --with-xslt-config=/usr/local/opt/libxslt/bin/xslt-config

基于:Mac fix 1 - Install the Nokogiri gem on Mac OS 10.9 Mavericks

其他解决方案:

> gem install nokogiri -v 1.6.3.1 -- --use-system-libraries --with-xml2-include=/usr/local/opt/libxml2/include/libxml2/

评论中的另一种解决方案:

> xcode-select --install gem install nokogiri

关于ruby - gem install nokogiri -v '1.6.3.1' on OS X 10.10 Yosemite 未安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26631482/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com