方式一:
1·进入官网获取最新下载命令
官网:https://brew.sh
按照图中命令安装一条即可:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
如果你安装不成功,报如下错,请继续往下看
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Operation timed out
解决方法:
在mac环境下可使用命令修改host
sudo vi /etc/hosts
添加host
199.232.28.133 raw.githubusercontent.com
方式二:(方式一没有走通,中途还是断了)
第一种方法会有下面这样的问题
error: RPC failed; curl 18 transfer closed with outstanding read data remain
于是到网上找答案,采用方法:命令行输入git config --global http.postBuffer 524288000;再重新安装,也没有走通
最终用脚本安装的这种方式解决了问题:
百度云盘自取脚本:链接:https://pan.baidu.com/s/1_xVvIp3mN1_uDrZb4OyhnQ 密码:ha5w
运行方式:
1)chmod 777 install.sh (给脚本权限)
2) ./install.sh (运行shell脚本)
脚本安装过程中,若出现 error: RPC failed; curl 18 transfer closed with outstanding read data remain,就敲下面这个命令
git config --global http.postBuffer 524288000
注:shell脚本原理及其他运行方式参考我的另一篇文章:
https://www.jianshu.com/p/b7312e3d464c
完