在MAC上安装homebrew事先博客进行安装,根据步骤进行下去,同样在brew update的时候出现报错:Error: /usr/local must be writable! 错误,在该文章中也给出解决办法(sudo chown -R $(whoami) /usr/local),但是这种方法对于高版本的OS来说,是解决不了的,会报chown: /usr/local: Operation not permitted错误。
解决办法:
先卸载已安装的homebrew,命令如下:
/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)"
通过该方法直接获取最新的homebrew,出现预期效果。