2012-09-27 2 views
8

Je tente d'installer nginx en utilisant le gestionnaire de paquets de brassage, mais il ne parvient pas à lier. Comment puis-je réparer cela?infusion installation nginx ne parvient pas à lier

roc-web5537:Downloads cmuench$ brew install nginx 
Warning: Your Xcode (4.3.3) is outdated 
Please install Xcode 4.5. 
==> Installing nginx dependency: pcre 
==> Downloading ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.31.tar.bz2 
Already downloaded: /Library/Caches/Homebrew/pcre-8.31.tar.bz2 
==> ./configure --prefix=/usr/local/Cellar/pcre/8.31 --enable-utf8 --enable-unicode-properties --enable-pcregrep-libz --enable-pcregrep-libbz2 
==> make test 
==> make install 
Warning: Could not link pcre. Unlinking... 
Error: The `brew link` step did not complete successfully 
The formula built, but is not symlinked into /usr/local 
You can try again using `brew link pcre' 
==> Summary 
/usr/local/Cellar/pcre/8.31: 130 files, 3.2M, built in 18 seconds 
==> Installing nginx 
==> Downloading http://nginx.org/download/nginx-1.2.4.tar.gz 
Already downloaded: /Library/Caches/Homebrew/nginx-1.2.4.tar.gz 
==> Patching 
patching file conf/nginx.conf 
==> ./configure --prefix=/usr/local/Cellar/nginx/1.2.4 --with-http_ssl_module --with-pcre --with-ipv6 --with-cc-opt=-I/usr/local/include --with-ld-opt=-L/usr/local/lib --conf-path=/usr/loca 
==> 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.4/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: Could not link nginx. Unlinking... 
Error: The `brew link` step did not complete successfully 
The formula built, but is not symlinked into /usr/local 
You can try again using `brew link nginx' 
Warning: /usr/local/sbin is not in your PATH 
You can amend this by altering your ~/.bashrc file 
==> Summary 
/usr/local/Cellar/nginx/1.2.4: 9 files, 952K, built in 9 seconds 

Répondre

18

J'ai eu ce problème il y a quelques jours avec l'installation de Yeoman. Il semble que certains dossiers de/usr/local ne vous appartiennent pas, ce qui peut poser problème. Dans mon cas, j'avais quelques dossiers dans/usr/local/comme ça.

Aller/usr/local

cd /usr/local 

Vérifie qui possède les dossiers

ls -l 

Effectuez les opérations suivantes pour les dossiers ne vous appartiennent pas (en remplacement de sous-foldername avec des sous-dossiers nommer évidemment):

sudo chown $(whoami) /usr/local/<sub-foldername> 

puis appelez

brew link pcre 

Il doit être lié avec succès.

Espérons que cela aide.

4

Cela peut parfois arriver s'il existe déjà des fichiers (ou des liens symboliques) portant le même nom. Pour forcer un lien, vous pouvez utiliser brew link -f pcre. Si vous voulez voir si des fichiers empêchent le lien, vous pouvez utiliser brew link --dry-run pcre.

Si aucun fichier n'est répertorié par brew link --dry-run pcre, il est probable que la réponse de jwwishart soit la bonne.

1

je devais supprimer manuellement et réinstaller PCRE et OpenSSL, nginx fonctionnera:

brew remove pcre 
brew remove openssl 
brew install pcre 
brew install openssl 
nginx 
Questions connexes