當我嘗試$ brew update
,我發現了錯誤:如何在libcurl中啓用https支持?
error: Protocol https not supported or disabled in libcurl while accessing https://github.com/mxcl/homebrew/info/refs?service=git-upload-pack
然而,當我$ curl --version
,我看到:
curl 7.21.4 (x86_64-apple-darwin12.2.0) libcurl/7.21.4 OpenSSL/0.9.8y zlib/1.2.5 libidn/1.20
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: IDN IPv6 Largefile NTLM SSL libz
除非我失去了一些東西,這對我來說很好。請注意,協議列表中列出了https
。
$ which curl
產生一個可疑響應:
/usr/local/php5/bin/curl
Hmmmmm ...也許brew
使用不同curl
(如一個在/usr/bin/curl
)。讓我們來看看:
$ /usr/bin/curl --version
curl 7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8y zlib/1.2.5
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate IPv6 Largefile NTLM NTLM_WB SSL libz
好吧,這顯然是一個不同的安裝的curl
,但它也是在協議列表列出https
,並有OpenSSL的信息也有。
順便說一句:如果我嘗試在我的機器上使用https
URL與任何git
回購,我會得到相同的錯誤。
問題:
如何確定的路徑curl
是brew
使用?- 如何在
libcurl
中啓用對https
的支持?
UPDATE:我能夠確定libcurl.4.dylib
的路徑git
(和brew
)由以下以下deltheil的方法,使用。路徑是:
/usr/lib/libcurl.4.dylib (compatibility version 6.0.0, current version 6.1.0)
所以,我想這一點:
$ brew install curl --with-libssh2
幸運的是捲曲可在非SSL URI,所以它實際上沒有insstall。它沒有符號鏈接到/usr/local
,但這對我來說很好(我認爲)。所以我這樣做:
$ cd /usr/lib
$ mv libcurl.4.dylib libcurl.4.dylib.bk
$ ln -s /usr/local/Cellar/curl/7.30.0/lib/libcurl.4.dylib libcurl.4.dylib
$ brew update
但它仍然拋出我這個錯誤:
error: Protocol https not supported or disabled in libcurl while accessing https://github.com/mxcl/homebrew/info/refs?service=git-upload-pack
所以,現在的問題變成獨家:如何啓用對libcurl
https
支持?
感謝@deltheil,你有我一半。我已經用當前的進度更新了這個問題。 –
因爲'git'正確鏈接到系統libcurl,它支持https,所以肯定有什麼問題。這就是說,你應該永遠**,永遠**修改你的系統文件在'/ usr/bin'下,'/ usr/lib'等等。我建議你運行一個'brew doctor'並檢查這個[Github HTTPS克隆錯誤](https://help.github.com/articles/https-cloning-errors)頁面。 – deltheil
或者你可能想通過Homebrew通過'with-brewed-curl'選項來正確安裝'git',這樣'git'就可以使用brew中的'curl',這取決於'darwinssl'的SSL支持。 – deltheil