2012-08-01 45 views
0

我前一段時間刪除了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

回答

1

聽起來好像你還沒有完全去除的MacPorts及其curl

如果你還沒有,你會想跟着導遊在http://guide.macports.org/chunked/installing.macports.uninstalling.html,具體如下:

$ sudo rm -rf \ 
    /opt/local \ 
    /Applications/DarwinPorts \ 
    /Applications/MacPorts \ 
    /Library/LaunchDaemons/org.macports.* \ 
    /Library/Receipts/DarwinPorts*.pkg \ 
    /Library/Receipts/MacPorts*.pkg \ 
    /Library/StartupItems/DarwinPortsStartup \ 
    /Library/Tcl/darwinports1.0 \ 
    /Library/Tcl/macports1.0 \ 
    ~/.macports 

之後,你會想用sudo rm /usr/local/bin/curl去除捲曲。

curllibcurl已包含在OS X中,但/usr/local/bin已在您的PATH之前/usr/bin。所以,在某個時候,你可能已經安裝了一個新版本的curl,現在剩下的就是MacPorts。

您將因此想要完全清除/usr/local中的curl材料。這可能最終會有點棘手,如果你沒有安裝很多Homebrew,在重新安裝Homebrew之前完全清除Homebrew並手動清除/usr/local可能是一個好主意。

最後,一旦curl消失,您將希望刪除取決於libcurl的gem並重新安裝。

如果在卸載MacPorts之前使用MacPorts卸載curl,但是我從未使用過MacPorts,所以這可能可能已被避免,因此不是100%。

+0

從系統中全面清除「curl」可能並不安全,更不用說它可能會在操作系統更新期間重新安裝。相反,應該改變他們的PATH來改變搜索順序。 – morgant 2012-08-01 14:50:40

+0

我應該澄清,我不建議清除'curl',而是清除MacPorts安裝到/ usr/local的'curl'副本。 OS X已經提供'curl'和'libcurl',並且這些版本可以和ruby一起工作。內置的'curl'位於'/ usr/bin/curl'中。完全同意你不想清除系統捲曲。 – 2012-08-01 15:06:32

+0

是的,但我沒有其他解決方案。我不得不清理很多東西,但它工作。 :) – HaNdTriX 2012-08-02 09:20:26