-
如果没有安装brew先安装
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
-
安装nginx
brew install nginx
-
有可能提示报错
Error: The following directories are not writable by your user: /usr/local/share/man/man8 You should change the ownership of these directories to your user. sudo chown -R $(whoami) /usr/local/share/man/man8
-
解决错误
sudo chown -R $(whoami) /usr/local/share/man/man8
-
重新安装
brew install nginx
-
启动测试
启动
完成!!希望有所帮助