然后再使用brew的时候就出现了下面的错误情况:
minixs-MacBook-Pro% brew update
Initialized empty Git repository in /usr/local/.git/
fatal: unable to access 'https://github.com/Homebrew/homebrew.git/': SSL certificate problem: unable to get local issuer certificate
Error: Failure while executing: git fetch origin一开始觉得是git使用了curl来拉github.com上面的东西,因为没证书导致出现,因为curl可以使用参数--cacert来指定证书文件,所以拼命在找/usr/local/Library/Homebrew/目录下的所有文件,看下里面有没curl,有的话就加上这个参数。哪知道都没有!
搞了一会后再想下,因为github.com是使用https来传输,那git也有可以是缺少证书才不能连,然后根据这个线索上google搜索
"git SSL certificate problem: unable to get local issuer certificate"
然后得到了一个正确的结果:
git config --system http.sslcainfo /usr/share/ssl/cacert.pem
这样的意思是加上sslcainfo的信息,而/usr/share/ssl/cacert.pem文件是网上下载的。运行上面一行后再运行
brew update
就成功了!唉!