当我尝试$ brew update
出现错误时:
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
嗯...可能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
使用?https
in的支持libcurl
?更新:通过遵循以下deltheil的方法libcurl.4.dylib
,我能够确定到该git
(和brew
)正在使用的路径。路径是:
/usr/lib/libcurl.4.dylib (compatibility version 6.0.0, current version 6.1.0)
所以我尝试了这个:
$ brew install curl --with-libssh2
幸运的是,curl在非SSL URI上可用,因此实际上确实安装了。它没有链接到/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
因此,现在的问题专门变成了:如何启用https
in支持libcurl
?
如何确定冲泡所使用的卷曲路径?
/usr/bin/curl
您可以在此处看到Homebrew的使用,即Mac OS X附带的版本。
话虽这么说,并且准确地说,您的问题可能与libcurl的版本有关,该版本与git
和关联并用于http://
和https://
。
执行awhich git
来确定您正在使用哪个版本(在下方安装了mine的版本/usr/local
)。
然后扫描共享库,如下所示:
$ otool -L /usr/local/git/libexec/git-core/git-http-push | grep curl
/usr/lib/libcurl.4.dylib
替换为/usr/local/
与您的相对应的安装目录git
。
由于您的git
执行人员使用的libcurl版本缺少HTTPS支持,因此这将告诉您该版本是什么以及它的安装位置。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句