背景:在 Mac 终端输入了 Homebrew 官网给的安装指令:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
问题1
执行命令报错权限问题
报错
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
如图:
解决方法:
执行命令sudo gem install redis
,之后再次执行安装命令,完美解决
问题2
安装过程中出现了错误:
error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
Failed during: git fetch origin --force
如图:
网上说是网络问题,确实ping github.com是有问题的
解决办法:
执行命令
sudo vi /etc/hosts
在最后一行添加13.229.188.59 github.com
保存退出后再次ping github.com,OK,完美解决
问题3
重新安装还是报错
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
Failed during: git fetch origin --force
如图
究其原因是因为curl的postBuffer的默认值太小,我们需要调整它的大小,在终端重新配置大小
在暂且把postBuffer的值配置成500M,对我来说够了。可以根据你需要下载的文件大小,将postBuffer值配置成合适的大小。
git config --global http.postBuffer 524288000
这样已经配置好了,如果你不确定,可以根据以下命令查看postBuffer。
git config --list
再次安装,完美解决
问题4
error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
Error: Failure while executing; `git clone https://github.com/Homebrew/homebrew-core /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core` exited with 128.
Error: Failure while executing; `/usr/local/bin/brew tap homebrew/core` exited with 1.
Failed during: /usr/local/bin/brew update --force
如图
解决方案: