gpt4 book ai didi

ruby-on-rails - ruby on rails - 问题包在 ruby​​ on rails 4.x 上安装 nokogiri 1.7.2

转载 作者:行者123 更新时间:2023-12-03 17:34:07 26 4
gpt4 key购买 nike

我在尝试捆绑安装 nokogiri 1.7.2 时遇到问题

我在用

gem 'rails', '4.2.4'
MacOS High Sierra version 10.13.6

我不确定出了什么问题

下面是我的错误输出:

完整的错误输出:

https://gist.github.com/axilaris/68e7df57c3e29366d7a1998eebd93517

这是错误描述的地方:
An error occurred while installing nokogiri (1.7.2), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.7.2'` succeeds before bundling.

In Gemfile:
rails_admin was resolved to 1.1.1, which depends on
rails was resolved to 4.2.4, which depends on
actionmailer was resolved to 4.2.4, which depends on
actionpack was resolved to 4.2.4, which depends on
actionview was resolved to 4.2.4, which depends on
rails-dom-testing was resolved to 1.0.8, which depends on
nokogiri

更新,不适用于 sudo gem install nokogiri
$ sudo gem install nokogiri -v '1.7.2'
Building native extensions. This could take a while...

....
Building Nokogiri with a packaged version of libxml2-2.9.4
with the following patches applied:
- 0001-Fix-comparison-with-root-node-in-xmlXPathCmpNodes.patch
- 0002-Fix-XPointer-paths-beginning-with-range-to.patch
- 0003-Disallow-namespace-nodes-in-XPointer-ranges.patch

Team Nokogiri will keep on doing their best to provide security
updates in a timely manner, but if this is a concern for you and want
to use the system library instead; abort this installation process and
reinstall nokogiri as follows:

gem install nokogiri -- --use-system-libraries
[--with-xml2-config=/path/to/xml2-config]
[--with-xslt-config=/path/to/xslt-config]

If you are using Bundler, tell it to use the option:

bundle config build.nokogiri --use-system-libraries
bundle install

Note, however, that nokogiri is not fully compatible with arbitrary
versions of libxml2 provided by OS/package vendors.
************************************************************************
Extracting libxml2-2.9.4.tar.gz into tmp/x86_64-apple-darwin17/ports/libxml2/2.9.4... OK
Running git apply with /Library/Ruby/Gems/2.3.0/gems/nokogiri-1.7.2/patches/libxml2/0001-Fix-comparison-with-root-node-in-xmlXPathCmpNodes.patch... OK
Running git apply with /Library/Ruby/Gems/2.3.0/gems/nokogiri-1.7.2/patches/libxml2/0002-Fix-XPointer-paths-beginning-with-range-to.patch... OK
Running git apply with /Library/Ruby/Gems/2.3.0/gems/nokogiri-1.7.2/patches/libxml2/0003-Disallow-namespace-nodes-in-XPointer-ranges.patch... OK
Running 'configure' for libxml2 2.9.4... OK
Running 'compile' for libxml2 2.9.4... ERROR, review '/Library/Ruby/Gems/2.3.0/gems/nokogiri-1.7.2/ext/nokogiri/tmp/x86_64-apple-darwin17/ports/libxml2/2.9.4/compile.log' to see what happened. Last lines are:
...

也许与此有关? https://github.com/sparklemotion/nokogiri/issues/1690

2018 年 9 月 18 日更新

我注意到我的笔记本电脑上的 rails 环境存在重大问题。我试图创建一个新的 rails 应用程序。 nokogiri 给我的环境造成了重大问题。这是什么问题以及如何解决这个问题?
https://gist.github.com/axilaris/03882e15d2cbd603279a654547752f9c

最佳答案

有时这很痛苦,我什至不确定为什么会随机发生这种情况。然而,这是我大部分时间解决它的方法。

brew unlink xz
gem install nokogiri
brew link xz

如果这没有帮助,请再次使用 libxml2 引发错误,您应该执行以下操作
brew install libxml2

进而
gem install nokogiri -- --use-system-libraries \
--with-xml2-include=$(brew --prefix libxml2)/include/libxml2

关于ruby-on-rails - ruby on rails - 问题包在 ruby​​ on rails 4.x 上安装 nokogiri 1.7.2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52169077/

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