gpt4 book ai didi

ruby-on-rails - nokogiri 无法安装 osx

转载 作者:行者123 更新时间:2023-12-04 16:28:59 25 4
gpt4 key购买 nike

我看到很多这类问题,但我的情况有点不同,所以我在做 bundle install得到了这个:

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

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20150109-25233-1jiriou.rb extconf.rb --with-iconv-dir=/usr/local/Cellar/libiconv/1.14/
checking if the C compiler accepts ... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
Building nokogiri using packaged libraries.
checking for iconv using --with-iconv-* flags... no
checking for iconv... no
-----
libiconv is missing. Please locate mkmf.log to investigate how it is failing.
-----
*** 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=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/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 /var/folders/sk/x8m9btmj1g58c906v0z3k2br0000gq/T/bundler20150109-25233-o53u4y/nokogiri-1.6.5/gems/nokogiri-1.6.5 for inspection.
Results logged to /var/folders/sk/x8m9btmj1g58c906v0z3k2br0000gq/T/bundler20150109-25233-o53u4y/nokogiri-1.6.5/extensions/universal-darwin-14/2.0.0/nokogiri-1.6.5/gem_make.out
An error occurred while installing nokogiri (1.6.5), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.5'` succeeds before bundling.

我安装了libiconv,我试过这种方式 gem install nokogiri -- --with-iconv-dir=/usr/local/Cellar/libiconv/1.14/ gem 安装正常,但比我尝试 bundle 我再次遇到相同的错误,同样的情况是当我尝试做 gem install nokogiri -v '1.6.5'安装没问题,我可以在 gems 列表中看到 gem,但似乎 bundler 没有看到它,我尝试将它包含在这个特定版本的 gem 文件中,但仍然有这个错误

最佳答案

这对我有用:http://www.nokogiri.org/tutorials/installing_nokogiri.html#using_nonstandard_libxml2___libxslt_installations

gem install nokogiri -- \
--use-system-libraries \
--with-xml2-config=/usr/bin/xml2-config \
--with-xslt-config=/usr/bin/xslt-config

然后 bundle update

关于ruby-on-rails - nokogiri 无法安装 osx,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27850503/

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