美文网首页
brew link error

brew link error

作者: jia_yan_chao | 来源:发表于2017-09-26 00:38 被阅读310次

    使用brew install nginx 安装nginx:

    ➜  ~ brew install nginx
    Updating Homebrew...
    ^C==> Downloading https://homebrew.bintray.com/bottles/nginx-1.12.1.sierra.bottle.tar.gz
    ^C
    ➜  ~ brew install nginx
    ==> Downloading https://homebrew.bintray.com/bottles/nginx-1.12.1.sierra.bottle.tar.gz
    ######################################################################## 100.0%
    ==> Pouring nginx-1.12.1.sierra.bottle.tar.gz
    Error: The `brew link` step did not complete successfully
    The formula built, but is not symlinked into /usr/local
    Could not symlink share/man/man8/nginx.8
    /usr/local/share/man/man8 is not writable.
    
    You can try again using:
      brew link nginx
    ==> Caveats
    Docroot is: /usr/local/var/www
    
    The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that
    nginx can run without sudo.
    
    nginx will load all files in /usr/local/etc/nginx/servers/.
    
    To have launchd start nginx now and restart at login:
      brew services start nginx
    Or, if you don't want/need a background service you can just run:
      nginx
    ==> Summary
    🍺  /usr/local/Cellar/nginx/1.12.1: 23 files, 1MB
    

    遇到的问题是:

    • 安装成功 brew link 失败了

    解决方法:

    • 非根治的手动创建连接文件。 (原因是brew 默认不让用sudo 权限, brew link 是需要在创建/usr/local/share/man/man8/nginx.8) ,
    ➜  ~ sudo ln -s /usr/local/Cellar/nginx/1.12.1/share/man/man8/nginx.8 /usr/local/share/man/man8/nginx.8
    

    或者直接创建一个名叫nginx.8的文件在 /user/local/share/man/nginx8/下;然后重写这个文件

    brew link nginx -f
    

    相关文章

      网友评论

          本文标题: brew link error

          本文链接:https://www.haomeiwen.com/subject/pxpjextx.html