Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all
build scripts full access to your system.
按照下面的方法,sudo chown -R $(whoami) /usr/local,依然是同样报错,我查看了brew的版本,和我之前的Mac不太一样。
解决方法: