brew install nginx无法链接 [英] brew install nginx fails to link

查看:221
本文介绍了brew install nginx无法链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Brew软件包管理器安装nginx,但是无法链接.我该如何解决?

I am attempting to install nginx using the brew package manager, but it fails to link. How can I fix this?

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

推荐答案

几天前,我在安装Yeoman时遇到了这个问题.看来/usr/local中的某些文件夹可能不属于您,这可能会导致问题.就我而言,我在/usr/local/中有几个文件夹.

I had this issue a few days ago with installation of Yeoman. It seems that some of the folders in /usr/local might not be owned by you and that can cause issues. In my case I had a couple of folders in /usr/local/ like that.

转到/usr/local

Go to /usr/local

cd /usr/local

检查谁拥有文件夹

ls -l

对不属于您的文件夹执行以下操作(用子文件夹名称替换子文件夹名称):

Do the following for folders not owned by you (replacing sub-foldername with sub folders name obviously):

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

然后致电

brew link pcre

它应该成功链接.

希望这会有所帮助.

这篇关于brew install nginx无法链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆