NGINX brew install command not found

Je ne

$ brew install nginx

et obtenez:

==> Downloading http://nginx.org/download/nginx-1.2.2.tar.gz
Already downloaded: /Library/Caches/Homebrew/nginx-1.2.2.tar.gz
==> Patching
patching file conf/nginx.conf
==> ./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
==> make
==> make install
==> Caveats
In the interest of allowing you to run `nginx` without `sudo`, the default
port is set to localhost:8080.

If you want to host pages on your local machine to the public, you should 
change that to localhost:80, and run `sudo nginx`. You'll need to turn off
any other web servers running port 80, of course.

You can start nginx automatically on login running as your user with:
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/nginx/1.2.2/homebrew.mxcl.nginx.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist

Though note that if running as your user, the launch agent will fail if you
try to use a port below 1024 (such as http's default of 80.)
Warning: /usr/local/sbin is not in your PATH
You can amend this by altering your ~/.bashrc file 

J'ai cela dans mon ~/.bashrc fichier:

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

Quand je lance nginx -v ou sudo nginx -t-je obtenir ceci:

-bash: nginx: command not found

je ne l'ai pas installé nginx correctement?

  • Lorsque vous exécutez echo $PATH, n' /usr/local/sbin apparaître?
  • Essayez de sourcing votre ~/.bashrc fichier et voir si il s'affiche: source ~/.bashrc.
  • Rien ne doit apparaître, mais votre $PATH variable doit être mis à jour. Essayez echo $PATH encore =) . Si ça ne marchait pas, il pourrait y avoir un problème avec votre .bashrc
  • Cela a été ajouté à ce que j'ai reçu précédemment :/Users/macuser/usr/local/sbin:/Users/macuser/.rvm/bin:/Users/macuser/usr/local/sbin
  • Je trouve ça bizarre que ça en ajoutant '/Users/macuser " pour le chemin d'accès que vous essayez d'exporter. C'est peut-être le problème, mais je ne sais pas comment vous aider =(
  • Merci!! c'était la question. Alors que j'étais à essayer différentes choses que j'avais changé pour "export PATH=$PATH:$HOME/usr/local/sbin". J'ai juste eu à enlever "$HOME". Je l'ai changé en arrière, couru source ~/.bashrc. Maintenant, la Nginx commande fonctionne 🙂
  • Super! Content d'avoir pu aider! =)

InformationsquelleAutor Benamir | 2012-10-03