@Konboi memo

主に技術に関してつらつらと。

brewでのnginx openrestyのインストールに嵌ったのでメモ

はじめに

OpenResty を使ってやりたいことがあったので 手元の環境(Mac)にhomebrewを使ってインストールしようと思ったらエラーがでて嵌ったのでメモ

TL;DR

brew install opensll
brew link --force opensll
brew install ngx_openresty

エラーになる

nginx openresty を homebrew でインストールする場合は

$ brew install ngx_openresty

でインストールできる

ただ、今回実行したら

...
checking for OpenSSL library ... not found

./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl=<path> option.
...

のような感じでopnesslのパスが見つけられない様子でエラーになった

解決方法

homebrewopensslをインストールしたら解決した

brew install openssl

このままだと /usr/bin/openssl が参照されるので

brew link --force openssl
source ~/.zshrc

これで homebrewでインストールしたopensslが参照されるので

brew install ngx_openssl

が上手く行った