gpt4 book ai didi

ruby-on-rails - 在升级到 Rails 4.2.0 时由于 libxml2 在 Mac OS X Yosemite v.10.10.1 上安装 Nokogiri 出现问题

转载 作者:行者123 更新时间:2023-12-04 05:49:43 26 4
gpt4 key购买 nike

我正在尝试在我的计算机上安装 Rails 4.2.0,但在安装 Nokogiri 时遇到问题。我按照“bundle install stopped at Nokogiri ”的第一个答案中的步骤进行操作,但是当我运行 brew install nokogiri 时,我得到以下信息:

Activating libxslt 1.1.28 (from /Users/dseibert/.rvm/rubies/ruby-2.2.0/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2/ports/x86_64-apple-darwin14.0.0/libxslt/1.1.28)...
checking for main() in -llzma... yes
checking for xmlParseDoc() in libxml/parser.h... no
checking for xmlParseDoc() in -lxml2... no
checking for xmlParseDoc() in -llibxml2... no
-----
libxml2 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
--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/dseibert/.rvm/rubies/ruby-2.2.0/bin/$(RUBY_BASE_NAME)
--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
--with-xml2lib
--without-xml2lib
--with-libxml2lib
--without-libxml2lib

extconf failed, exit code 1

Gem files will remain installed in /Users/dseibert/.rvm/rubies/ruby-2.2.0/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2 for inspection.
Results logged to /Users/dseibert/.rvm/rubies/ruby-2.2.0/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0/nokogiri-1.6.6.2/gem_make.out

我找不到 mkmf 文件来定位我的 libxml2 文件的详细信息,而且我在 Ruby 源文件夹中没有看到 libxml2 文件或 Nokogiri 文件夹。

当我运行时 brew install libxml2 , 我得到 Warning: libxml2-2.9.2 already installed .

在评论之后,我得到了回复: Successfully installed nokogiri-1.6.6.2 .但是当我跑 sudo gem install rails ,我又回到了上面的错误。

最佳答案

尝试这个

gem install nokogiri -- --use-system-libraries=true --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2/

这适用于 OSX 10.11 El Capitan

关于ruby-on-rails - 在升级到 Rails 4.2.0 时由于 libxml2 在 Mac OS X Yosemite v.10.10.1 上安装 Nokogiri 出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28258450/

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