安装 Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
安装出现以下错误:
正在连接 raw.githubusercontent.com (raw.githubusercontent.com)|0.0.0.0|:443… 失败:拒绝连接。
正在连接 raw.githubusercontent.com (raw.githubusercontent.com)|:😐:443… 失败:拒绝连接。
解决方案:
进入网站:https://site.ip138.com/raw.Githubusercontent.com/
输入raw.githubusercontent.com
查询其相关的IP地址:

在Mac终端输入:
sudo vi /etc/hosts
选择上面一个添加内容即可:

比如:
151.101.76.133 raw.githubusercontent.com
或者
151.101.228.133 raw.githubusercontent.com
然后保存,退出
再次安装 Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
安装成功

安装出现以下错误:
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: early EOF

解决方案:
可以使用命令修复
git config --global http.postBuffer 524288000
注意:执行完这里的命令之后需要关闭终端,然后重新执行安装命令才会有效。这里是对Git对配置,个人觉的安装最新版的git应该也可以解决,没有尝试。
sudo vim .bash_profile
添加
export PATH=/usr/local/bin:$PATH
保存,
source .bash_profile
使配置修改生效。
重新启动终端

本文详细介绍了在Mac上安装Homebrew过程中可能遇到的连接错误及RPC失败问题,并提供了具体的解决方案,包括修改hosts文件、更新Git配置及环境变量设置。
1462

被折叠的 条评论
为什么被折叠?



