3

これは私の時間を何時間も費やしました。

私が実行するコンソールで:require '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" で再インストールしようとしましたが、インストール時にエラーや警告は表示されません。

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. Ruby のバージョン管理システムを rvm から切り替えたため、正しいパッケージで gem を再構築する必要がありました。

于 2014-09-17T21:51:19.250 に答える