我前一段時間刪除了Macports,所以現在我使用Homebrew。 現在我正在嘗試使用typhoeus紅寶石寶石,這取決於multicurl。libcurl從MacPorts切換到Homebrew後缺少庫文件
當我嘗試執行我rubyscript我收到以下錯誤-消息:
/Users/myusername/.rvm/gems/ruby-1.9.3-p125/gems/ffi-1.0.11/lib/ffi/library.rb:121:in `block in ffi_lib': Could not open library 'libcurl': dlopen(libcurl, 10): image not found. (LoadError) Could not open library 'libcurl.dylib': dlopen(libcurl.dylib, 10): Library not loaded: /opt/local/lib/libidn.11.dylib Referenced from: /usr/local/lib/libcurl.dylib Reason: image not found from /Users/myusername/.rvm/gems/ruby-1.9.3-p125/gems/ffi-1.0.11/lib/ffi/library.rb:88:in `map' from /Users/myusername/.rvm/gems/ruby-1.9.3-p125/gems/ffi-1.0.11/lib/ffi/library.rb:88:in `ffi_lib' from /Users/myusername/.rvm/gems/ruby-1.9.3-p125/gems/typhoeus-0.4.2/lib/typhoeus/curl.rb:405:in `<module:Curl>' from /Users/myusername/.rvm/gems/ruby-1.9.3-p125/gems/typhoeus-0.4.2/lib/typhoeus/curl.rb:6:in `<module:Typhoeus>' from /Users/myusername/.rvm/gems/ruby-1.9.3-p125/gems/typhoeus-0.4.2/lib/typhoeus/curl.rb:5:in `<top (required)>' from /Users/myusername/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require' from /Users/myusername/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require' from /Users/myusername/.rvm/gems/ruby-1.9.3-p125/gems/typhoeus-0.4.2/lib/typhoeus.rb:5:in `<top (required)>' from /Users/myusername/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require' from /Users/myusername/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require' from /Users/myusername/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require' from app.rb:3:in `<main>'
顯然,有些文件丟失。
當我執行$ otool -L /usr/local/bin/curl
我得到:
/usr/local/lib/libcurl.4.dylib (compatibility version 7.0.0, current version 7.0.0)
/opt/local/lib/libidn.11.dylib (compatibility version 18.0.0, current version 18.5.0)
/opt/local/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
/opt/local/lib/libiconv.2.dylib (compatibility version 8.0.0, current version 8.1.0)
/System/Library/Frameworks/LDAP.framework/Versions/A/LDAP (compatibility version 1.0.0, current version 2.2.0)
/opt/local/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/opt/local/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
的這裏的問題是,我的文件夾/opt/local/
甚至不存在。
- 如何修復缺失的鏈接?
- 我在哪裏得到丟失的文件? (libidn.11.dylib,libintl.8.dylib,libssl.1.0.0.dylib,libcrypto.1.0.0.dylib和libz.1.dylib)?
其他相關信息:
- 我使用Ruby 1.9.3和Mac OSX 10.8
從系統中全面清除「curl」可能並不安全,更不用說它可能會在操作系統更新期間重新安裝。相反,應該改變他們的PATH來改變搜索順序。 – morgant 2012-08-01 14:50:40
我應該澄清,我不建議清除'curl',而是清除MacPorts安裝到/ usr/local的'curl'副本。 OS X已經提供'curl'和'libcurl',並且這些版本可以和ruby一起工作。內置的'curl'位於'/ usr/bin/curl'中。完全同意你不想清除系統捲曲。 – 2012-08-01 15:06:32
是的,但我沒有其他解決方案。我不得不清理很多東西,但它工作。 :) – HaNdTriX 2012-08-02 09:20:26