gpt4 book ai didi

ruby-on-rails - 库版本不兼容:nokogiri.bundle需要版本11.0.0或更高版本,但libxml2.2.dylib

转载 作者:行者123 更新时间:2023-12-03 12:03:23 25 4
gpt4 key购买 nike

尝试在Hartl教程中运行rspec时遇到此错误。我在错误中进行了搜索,但从未针对特定版本进行过修复,而这些修复实际上并不能解决我的问题。

/Users/Jimbo/.rvm/gems/ruby-2.0.0-p247/gems/nokogiri-1.6.0/lib/nokogiri.rb:28:in `require': dlopen(/Users/Jimbo/.rvm/gems/ruby-2.0.0-p247/gems/nokogiri-           1.6.0/lib/nokogiri/nokogiri.bundle, 9): Library not loaded:    /Users/Jimbo/.bundler/tmp/22862/gems/nokogiri-1.6.0/ports/i686-apple-   darwin11/libxml2/2.8.0/lib/libxml2.2.dylib (LoadError)
Referenced from: /Users/Jimbo/.rvm/gems/ruby-2.0.0-p247/gems/nokogiri- 1.6.0/lib/nokogiri/nokogiri.bundle
Reason: Incompatible library version: nokogiri.bundle requires version 11.0.0 or later, but libxml2.2.dylib provides version 10.0.0 - /Users/Jimbo/.rvm/gems/ruby-2.0.0-p247/gems/nokogiri-1.6.0/lib/nokogiri/nokogiri.bundle
from /Users/Jimbo/.rvm/gems/ruby-2.0.0-p247/gems/nokogiri-1.6.0/lib/nokogiri.rb:28:in `<top (required)>'
from /Users/Jimbo/.rvm/gems/ruby-2.0.0-p247/gems/capybara-2.1.0/lib/capybara.rb:2:in `require'
from /Users/Jimbo/.rvm/gems/ruby-2.0.0-p247/gems/capybara-2.1.0/lib/capybara.rb:2:in `<top (required)>'
from /Users/Jimbo/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
from /Users/Jimbo/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /Users/Jimbo/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
from /Users/Jimbo/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
from /Users/Jimbo/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from /Users/Jimbo/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from /Users/Jimbo/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'

最佳答案

我建议您首先使用以下方法卸载Nokogiri:

sudo gem uninstall nokogiri

然后使用rubygems安装Nokogiri:
gem install nokogiri

如果这不起作用,则在Nokogiri上有一个 open issue支持libxml 2.9.0及更高版本。为准备下一个libxml2版本启动了一个 libxml2-2.9.1 branch

然后尝试从Gemfile中的该分支中拉出,如下所示:
gem "nokogiri", github: "sparklemotion/nokogiri", branch: "libxml2-2.9.1"

或安装旧版本的libxml2。

如果仍然无法解决问题,您可能还需要尝试以下建议: What to do if libxml2 is being a jerk.

关于ruby-on-rails - 库版本不兼容:nokogiri.bundle需要版本11.0.0或更高版本,但libxml2.2.dylib,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18818926/

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