3

这占用了我几个小时的时间。

在我运行的控制台中:需要'curb'

我得到错误:

LoadError: dlopen(/usr/local/lib/ruby/gems/1.8/gems/taf2-curb-0.5.4.0/lib/curb_core.bundle, 9): no suitable image found. Did find:

/usr/local/lib/ruby/gems/1.8/gems/taf2-curb-0.5.4.0/lib/curb_core.bundle: mach-o, but wrong architecture - /usr/local/lib/ruby/gems/1.8/gems/taf2-curb-0.5.4.0/lib/curb_core.bundle
from /usr/local/lib/ruby/gems/1.8/gems/taf2-curb-0.5.4.0/lib/curb_core.bundle
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /Users/user/Sites/CSG/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
from /Users/user/Sites/CSG/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /Users/user/Sites/CSG/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/taf2-curb-0.5.4.0/lib/curb.rb:1
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /Users/user/Sites/CSG/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
from /Users/user/Sites/CSG/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /Users/user/Sites/CSG/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
from ./lib/tokbox/base_api.rb:7

我已经尝试卸载 gem 并使用 ARCHFLAGS="-arch i386" 重新安装多个版本 安装中没有给出错误或警告当我尝试安装时:rake install 我也收到此错误。

我正在使用 ruby​​ 1.8 开发 mac ox 10.6

我注意到我的 /usr/lib 文件夹中有 libcurl.4.dylib、libcurl.3.dylib、libcurl.2.dlib 和 libcurl.dylib...

我安装了最新的 7.20 curl 包。

我也尝试从源安装并收到此错误

localhost:taf2-curb-ac0b465 user$ rake install
(in /Users/user/Downloads/taf2-curb-ac0b465)
/Users/user/Downloads/taf2-curb-ac0b465/ext/curb_core.bundle: dlopen(/Users/user/Downloads/taf2-curb-ac0b465/ext/curb_core.bundle, 9): no suitable image found.  Did find: (LoadError)
    /Users/user/Downloads/taf2-curb-ac0b465/ext/curb_core.bundle: mach-o, but wrong architecture - /Users/user/Downloads/taf2-curb-ac0b465/ext/curb_core.bundle
    from /Users/user/Downloads/taf2-curb-ac0b465/lib/curb.rb:1
    from /Users/user/Downloads/taf2-curb-ac0b465/tests/helper.rb:12:in `require'
    from /Users/user/Downloads/taf2-curb-ac0b465/tests/helper.rb:12
    from ./tests/tc_curl_download.rb:1:in `require'
    from ./tests/tc_curl_download.rb:1
    from /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `load'
    from /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5
    from /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `each'
    from /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5
rake aborted!
Command failed with status (1): [/usr/local/bin/ruby -I"lib" "/usr/local/li...]

建议?

4

3 回答 3

6

试试看嘛 :

sudo env ARCHFLAGS="-arch x86_64" gem install curb

为我工作。

于 2010-07-02T09:34:27.813 回答
0

我有一个非常相似的问题,也耗费了我数小时的时间。我稍后在尝试使用代理时遇到了更多问题,但为了解决该错误,我必须从 sourceforge 下载 libcurl 源并构建它。

我相信 Snow Leopard 放弃了 PPC 支持,而且这个库可能不是 x86 原生的。重新编译解决了这个问题(可能),所以试一试。

于 2010-04-05T14:29:30.873 回答
0

从 rvm 切换到 chruby 时,我出现了这个问题。

/Users/lfender/source/rentals/vendor/ruby/1.9.1/gems/curb-0.7.15/lib/curb.rb:1:in `require':
dlopen(/Users/lfender/source/rentals/vendor/ruby/1.9.1/gems/curb-0.7.15/lib/curb_core.bundle,   
9) Library not loaded: /Users/lfender/.rvm/rubies/ruby-1.9.3-p484/lib/libruby.1.9.1.dylib (LoadError)
Reason: image not found - /Users/lfender/source/rentals/vendor/ruby/1.9.1/gems/curb-0.7.15/lib/curb_core.bundle

请注意这一点:Library not loaded: /Users/lfender/.rvm/rubies/ruby-1.9.3-p484/lib/libruby.1.9.1.dylib. 因为我从 rvm 切换了我的 ruby​​ 版本控制系统,所以我需要使用正确的包重新构建 gem。

于 2014-09-17T21:51:19.250 回答