检测是否安装homebrew
安装HomeBrew的官网
执行命令安装:
解决方案1:
打开网站: https://www.ipaddress.com/
查询一下 raw.githubusercontent.com对应的IP 地址
查询出来结果比较多,我就选择了第一个
修改目录 /etc/hosts文件
重新执行下载命令
结果:
并没有安装成功,查资料,应该是南墙的原因,所以使用镜像,不撞南墙了
镜像比较多,我就是用了清华的镜像
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"
看结果是安装成功了,可是brew -v还是找不到,继续查资料,解决方案:需要配置brew的安装路径到环境边聊,好吧,继续
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
搞定收工,散会~