码迷,mamicode.com
首页 > 其他好文 > 详细

openresty环境搭建问题记录

时间:2017-12-20 13:32:44      阅读:778      评论:0      收藏:0      [点我收藏+]

标签:fail   div   mac   sudo   developer   into   wro   nbsp   浏览器   

第一次在mac安装遇到如下问题:

截图:

技术分享图片

具体code如下:

Sonofelice:bch-flowrouter baidu$ brew install openresty/brew/openresty
Updating Homebrew...
==> Homebrew has enabled anonymous aggregate user behaviour analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics.html

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Error: Failure while executing: git config --local --replace-all homebrew.analyticsmessage true
==> Tapping openresty/brew
Cloning into ‘/usr/local/Homebrew/Library/Taps/openresty/homebrew-brew‘...
remote: Counting objects: 72, done.
remote: Compressing objects: 100% (72/72), done.
remote: Total 72 (delta 1), reused 44 (delta 0), pack-reused 0
Unpacking objects: 100% (72/72), done.
Tapped 62 formulae (162 files, 131.7KB)
==> Installing openresty from openresty/brew
Error: The following formula:
  openresty
cannot be installed as a binary package and must be built from source.
Install the Command Line Tools:
  xcode-select --install

Sonofelice:bch-flowrouter baidu$ brew untap homebrew/nginx
Error: No available tap homebrew/nginx.
Sonofelice:bch-flowrouter baidu$ xcode-select --install
xcode-select: note: install requested for command line developer tools

我遇到上面的错误,主要是因为缺少xcode-select

xcode-select --install

会弹出插件安装框,安装好之后再执行

brew install openresty/brew/openresty

进行安装即可。

安装完成后,启动openresty,命令行直接输入openresty即可。可能会看到如下错误:

nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)

这是因为非root用户没有启动权限。使用sudo openresty启动即可。

在浏览器输入:http://127.0.0.1/

看到如下页面则表示openresty启动成功

技术分享图片

 

openresty环境搭建问题记录

标签:fail   div   mac   sudo   developer   into   wro   nbsp   浏览器   

原文地址:http://www.cnblogs.com/sonofelice/p/8072570.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!