Mac安装brew(遇到的坑)

1.安装方法:

网上都会有

命令行输入 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

然后执行brew

Error: /usr/local must be writable!

解决办法 sudo chown -R $(whoami) /usr/local    $(whoami)为当前用户名

chown: /usr/local: Operation not permitted 

这种方法对于高版本的OS来说,是解决不了的,我们可以选择直接下载最新版本的

需要先卸载

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

 然后安装

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

如果有报错

fatal: unable to access;Failed connect to github.com

或者 ping Github.com 不通的 

这时候需要git config --global http.proxy

查询当前设置了代理

然后git config --global --unset http.proxy 取消设置 

再执行 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 进行安装

安装到

Press RETURN to continue or any other key to abort  

回车键 

遇到上面说明安装成功

brew测试下

ok,如有不懂,或者遇到什么别的问题加群讨论。

猜你喜欢

转载自www.cnblogs.com/chaihy/p/9453852.html