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

nyc*_*dtd 5 ruby macos homebrew ruby-on-rails libiconv

为了在我的mac上为rails项目安装mysql,我遵循在线建议安装自制程序和删除mac端口.这就是问题的开始.rails项目不会构建,我得到这个:

[rake --prereqs]耙子流产了!

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

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

/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`requirement'

...

我试过跑步的建议

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运行'configure'...确定

为libxml2 2.8.0运行'compile'...好的

为libxml2 2.8.0运行'install'...确定

激活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运行'configure'1.1.26 ......好的

为libxslt 1.1.26运行'compile'...好的

为libxslt 1.1.26运行'install'...好的

激活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 --without-make-prog --srcdir =.--curdir --ruby =/Users/Parker/.rvm/rubies/ruby​​-2.0.

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个小时.我已经尝试了每个链接,每个建议谷歌供应我.我完全难过了.在我看来,我已经过头了,造成了一些环境问题.我意识到可能需要更多信息,但我不知道要提供什么.请让我知道其他信息有助于诊断问题.

nyc*_*dtd 11

我终于找到了解决我问题的一系列建议:

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

brew tap homebrew/dupes

然后:

brew安装libiconv

brew link --force libiconv

显然'brew tap homebrew/dupes'允许我使用'brew install libiconv'而没有错误,从那里'brew链接--force libiconv'解决了这个问题.