2010-02-28 57 views
3

這消耗了我的時間。Mac上的遏制寶石問題Snow Leopard

在控制檯

我運行:需要「遏制」

我得到的錯誤:

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 

我試圖卸載寶石並重新安裝了一些與ARCHFLAGS =版本「 - 拱i386的」 安裝中沒有錯誤或警告 當我嘗試安裝:rake install 我也遇到了這個錯誤。

我工作在Mac牛10.6紅寶石1.8

我注意到有libcurl.4.dylib,libcurl.3.dylib和libcurl.2.dlib和libcurl.dylib在我的/ usr/lib文件夾...

我安裝了最新的7.20捲曲軟件包。

我試圖從源頭上安裝以及和得到這個錯誤

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...] 

建議?

回答

0

我有一個非常類似的問題,也消耗了幾個小時的時間。以後在嘗試使用代理時遇到更多問題,但爲了解決該錯誤,我必須從sourceforge下載libcurl源並構建它。

我相信Snow Leopard放棄了對PPC的支持,這個庫可能不是x86本機。重新編譯解決了這個問題(可能),所以試試看。

6

只是嘗試:

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

爲我工作。

+0

你已經保存了我的一天。 – 2010-08-03 02:26:42

+0

也是我的!乾杯 – miccet 2011-02-08 09:48:55

+0

太棒了,這對我很有用! – 2011-06-23 12:09:30

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。