Homebrew官方地址戳我。
打开终端,安装命令如下:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
安装到最后会有类似的报错:
Error: Failed to link all completions, docs and manpages:
Permission denied @ rb_file_s_symlink - (../../../Homebrew/manpages/README.md, /usr/local/share/man/man1/README.md)
Failed during: /usr/local/bin/brew update --force
YuMBP:~ yu$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
意思是说,权限不足
解决办法是通过给文件添加权限,分别执行两条命令如下:
sudo chgrp -R admin /usr/local
sudo chmod -R g+w /usr/local
执行这两句命令之后,再重新执行开始安装homebrew的命令,即可成功!
网友评论