安装命令
/bin/bash -c "$(curl -fsSL https:/raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
安装报错
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
443 端口连接被拒一般是因为墙的原因,如果你可以科学上网(Virtual Private Network)的话,在命令行键以下命令执行:
# 7890 和 789 需要换成你自己的端口
export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:789
注意:添加上述代理之后,终端所有session都是f墙的,解决办法是关掉终端就好了
添加brew到环境变量
- Run these two commands in your terminal to add Homebrew to your PATH:
(echo; echo 'eval "$(/usr/local/bin/brew shellenv)"') >> /Users/liy/.bash_profile
eval "$(/usr/local/bin/brew shellenv)"