mac安装hombrew报错error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
问题描述
在 Mac 终端输入了 Homebrew 官网给的安装指令:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
结果安装到最后出现了错误:
fatal: unable to access 'https://github.com/Homebrew/brew/': Could not resolve host: github.com
Failed during: git fetch origin master:refs/remotes/origin/master --tags --force
都说是网不通,可是我也挂着 ss,应该不是这个问题,很多解决方法是修改成镜像的链接,不过貌似都不见效。试着在终端 ping 了一下 GitHub 的地址:
ping github.com
结果网不通。
解决方案
修改 host 配置,在终端中输入下列指令,打开编辑文件。
sudo vi /etc/hosts
按 s键 进入编辑模式,在最下面添加 13.229.188.59 github.com
再次尝试在终端 ping github.com,发现已经成功了。
常见问题
在安装过程中,出现如下错误,也是网不通
error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
fatal: The remote end hung up unexpectedly