bash – 找不到NGINX brew install命令

前端之家收集整理的这篇文章主要介绍了bash – 找不到NGINX brew install命令前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我做

  1. $brew install Nginx

得到:

  1. ==> Downloading http://Nginx.org/download/Nginx-1.2.2.tar.gz
  2. Already downloaded: /Library/Caches/Homebrew/Nginx-1.2.2.tar.gz
  3. ==> Patching
  4. patching file conf/Nginx.conf
  5. ==> ./configure --prefix=/usr/local/Cellar/Nginx/1.2.2 --with-http_ssl_module --with-pcre --with-ipv6 --with-cc-opt=-I/usr/local/include --with-ld-opt=-L/usr/local/lib --conf
  6. ==> make
  7. ==> make install
  8. ==> Caveats
  9. In the interest of allowing you to run `Nginx` without `sudo`,the default
  10. port is set to localhost:8080.
  11. If you want to host pages on your local machine to the public,you should
  12. change that to localhost:80,and run `sudo Nginx`. You'll need to turn off
  13. any other web servers running port 80,of course.
  14. You can start Nginx automatically on login running as your user with:
  15. mkdir -p ~/Library/LaunchAgents
  16. cp /usr/local/Cellar/Nginx/1.2.2/homebrew.mxcl.Nginx.plist ~/Library/LaunchAgents/
  17. launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.Nginx.plist
  18. Though note that if running as your user,the launch agent will fail if you
  19. try to use a port below 1024 (such as http's default of 80.)
  20. Warning: /usr/local/sbin is not in your PATH
  21. You can amend this by altering your ~/.bashrc file

我在〜/ .bashrc文件中有这个:

  1. export PATH=$PATH:/usr/local/sbin

当我运行Nginx -v或sudo Nginx -t我得到这个:

  1. -bash: Nginx: command not found

我没有正确安装Nginx吗?

最佳答案
运行echo $PATH,/usr/local / sbin会出现吗?
如果不:
尝试获取〜/ .bashrc文件并查看它是否出现:source~ / .bashrc

再次运行echo $PATH.它应该是apear.

猜你在找的Nginx相关文章