首页 > 解决方案 > 在 mac 上使用 brew 命令安装特定版本的 nginx

问题描述

任何人都可以使用 brew 命令帮助安装特定的 nginx 版本(1.9.1)吗?

我试过 brew install nginx@1.9.1 但得到以下错误:

   ==> Searching for similarly named formulae...
   Error: No similarly named formulae found.
   Error: No available formula or cask with the name "nginx@1.9.1".
   ==> Searching for a previously deleted formula (in the last month)...
   Error: No previously deleted formula found.
   ==> Searching taps on GitHub...
   Error: No formulae found in taps.

标签: nginxhomebrew

解决方案


你可以试试brew install chenrui333/tap/nginx,应该能解决你的问题。

安装测试:

$ brew install chenrui333/tap/nginx
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
Updated 9 formulae.

==> Installing nginx from chenrui333/tap
==> Downloading https://homebrew.bintray.com/bottles/nginx-1.19.1.mojave.bottle.tar.gz
Already downloaded: /Users/rchen/Library/Caches/Homebrew/downloads/dad9c78801ef69c5886adbf450317ca2ac10c3f1dc643b6401e9104dcb87b2b0--nginx-1.19.1.mojave.bottle.tar.gz
==> Pouring nginx-1.19.1.mojave.bottle.tar.gz
==> 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 chenrui333/tap/nginx now and restart at login:
  brew services start chenrui333/tap/nginx
Or, if you don't want/need a background service you can just run:
  nginx
==> Summary
  /usr/local/Cellar/nginx/1.19.1: 25 files, 2.1MB

推荐阅读