库版本不兼容:nokogiri.bundle 需要 8.0.0 或更高版本,但 libiconv.2.dylib 提供 7.0.0 版本

Posted

技术标签:

【中文标题】库版本不兼容:nokogiri.bundle 需要 8.0.0 或更高版本,但 libiconv.2.dylib 提供 7.0.0 版本【英文标题】:Incompatible library version: nokogiri.bundle requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0 【发布时间】:2013-10-01 10:45:43 【问题描述】:

为了在我的 mac 上为 rails 项目安装 mysql,我遵循了安装自制软件和删除 mac 端口的在线建议。这就是问题开始的地方。 rails 项目无法构建,我得到了这个:

[rake --prereqs] rake 中止!

dlopen(/Users/Parker/.rvm/gems/ruby-1.9.3-p448/gems/nokogiri-1.6.0/lib/nokogiri/nokogiri.bundle, 9):

库未加载:/opt/local/lib/libiconv.2.dylib

引用自:/Users/Parker/.rvm/gems/ruby-1.9.3-p448/gems/nokogiri-1.6.0/lib/nokogiri/nokogiri.bundle

原因:

/Users/Parker/.rvm/gems/ruby-1.9.3-p448/gems/nokogiri-1.6.0/lib/nokogiri/nokogiri.bundle /Users/Parker/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `require'

...

我已经尝试过运行的建议

brew 安装 libiconv

我收到消息的对象:

错误:没有可用的 libiconv 公式 Apple 在 OS X 中分发 libiconv,您可以在 /usr/lib 中找到它。 某些构建脚本无法正确检测到它,请检查现有的 解决方案的公式。

我也试过了

gem install nokogiri -- --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28 --with-xml2-dir=/usr/local/Cellar/libxml2/2.9.1

我收到的:

错误:安装 nokogiri 时出错:

错误:构建 gem 原生扩展失败。

/Users/Parker/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28 --with -xml2-dir=/usr/local/Cellar/libxml2/2.9.1 将libxml2-2.8.0.tar.gz解压到tmp/x86_64-apple-darwin12.5.0/ports/libxml2/2.8.0... OK

为 libxml2 2.8.0 运行“配置”...好的

为 libxml2 2.8.0 运行“编译”... OK

正在为 libxml2 2.8.0 运行“安装”...好的

激活 libxml2 2.8.0(来自 /Users/Parker/.rvm/gems/ruby-2.0.0-p247/gems/nokogiri-1.6.0/ports/x86_64-apple-darwin12.5.0/libxml2/2.8。 0)...

将 libxslt-1.1.26.tar.gz 解压到 tmp/x86_64-apple-darwin12.5.0/ports/libxslt/1.1.26... 好

为 libxslt 1.1.26 运行“配置”...好的

为 libxslt 1.1.26 运行“编译”...好的

为 libxslt 1.1.26 运行“安装”...好的

激活 libxslt 1.1.26(来自 /Users/Parker/.rvm/gems/ruby-2.0.0-p247/gems/nokogiri-1.6.0/ports/x86_64-apple-darwin12.5.0/libxslt/1.1。 26)...

正在检查 libxml/parser.h... 否

> ----- 缺少 libxml2。请访问http://nokogiri.org/tutorials/installing_nokogiri.html 帮助安装依赖项。 -----

*** extconf.rb 失败 *** 由于某种原因无法创建 Makefile,可能缺乏必要 库和/或标题。检查 mkmf.log 文件以获取更多详细信息。你可以 需要配置选项。

提供的配置选项: --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 --没有-make-prog --srcdir=。 --curdir --ruby=/Users/Parker/.rvm/rubies/ruby-2.0.0-p247/bin/ruby --with-zlib-dir --没有-zlib-dir --with-zlib-include --without-zlib-include=$zlib-dir/include --with-zlib-lib --without-zlib-lib=$zlib-dir/lib --with-iconv-dir --without-iconv-dir --with-iconv-include --without-iconv-include=$iconv-dir/include --with-iconv-lib --without-iconv-lib=$iconv-dir/lib --with-xml2-dir --with-xml2-include --without-xml2-include=$xml2-dir/include --with-xml2-lib --without-xml2-lib=$xml2-dir/lib --with-xslt-dir --with-xslt-include --without-xslt-include=$xslt-dir/include --with-xslt-lib --without-xslt-lib=$xslt-dir/lib --with-libxslt-config --without-libxslt-config --with-pkg-config --without-pkg-config --with-libxml-2.0-config --without-libxml-2.0-config --with-libiconv-config --without-libiconv-config

Gem 文件将继续安装在 /Users/Parker/.rvm/gems/ruby-2.0.0-p247/gems/nokogiri-1.6.0 以供检查。

结果记录到 /Users/Parker/.rvm/gems/ruby-2.0.0-p247/gems/nokogiri-1.6.0/ext/nokogiri/gem_make.out

我已经努力解决这个问题超过 8 小时。我已经尝试了每一个链接和每一个谷歌提供给我的建议。我完全被难住了。在我看来,我有点不知所措,并造成了一些环境问题。我意识到可能需要更多信息,但我不知道该提供什么。请让我知道还有哪些其他信息可以帮助诊断问题。

【问题讨论】:

【参考方案1】:

我终于找到了解决我的问题的建议组合:

http://www.rqna.net/qna/swryr-bundle-install-stopped-at-nokogiri.html

brew tap homebrew/dupes

然后:

brew 安装 libiconv

brew 链接 --force libiconv

显然,“brew tap homebrew/dupes”允许我使用“brew install libiconv”而不会出现错误,并且“brew link --force libiconv”从那里解决了这个问题。

【讨论】:

以上是关于库版本不兼容:nokogiri.bundle 需要 8.0.0 或更高版本,但 libiconv.2.dylib 提供 7.0.0 版本的主要内容,如果未能解决你的问题,请参考以下文章

Python 错误消息“库版本不兼容”libxml 和 etree.so

使用 ivy 兼容库时是不是仍需要运行 ngcc

记录一次toml库CommonJS规范与项目不兼容的问题

libc库 与 MYSQL 不兼容 如何处理?

基于 APR 的 Apache Tomcat 本机库的不兼容版本 [1.1.34]

库版本之间的 Swift 兼容性