killercup / homebrew-openresty

Tap for Homebrew that supports OpenResty
MIT License
28 stars 16 forks source link

Installation fails, unable to find OpenSSL library #22

Open rlamorea opened 9 years ago

rlamorea commented 9 years ago

Trying brew install ngx_openresty and get:

==> Installing ngx_openresty from killercup/homebrew-openresty
==> Downloading http://openresty.org/download/ngx_openresty-1.7.10.2.tar.gz
Already downloaded: /Library/Caches/Homebrew/ngx_openresty-1.7.10.2.tar.gz
==> ./configure --prefix=/usr/local/Cellar/ngx_openresty/1.7.10.2 --with-http_ssl_module --with-pcre --with-pcre-jit --sbin-path=/usr/local/Cellar/ngx_openresty/1.7.10.2/bin/openresty --conf-path=/usr/local/etc/openresty/nginx.conf --pid-path=/usr/local/var/run/openresty.pid --lock-path=/usr/local/var/openresty/nginx.lock
Last 15 lines from /Users/srh/Library/Logs/Homebrew/ngx_openresty/01.configure:
 + ngx_http_redis_module was configured
adding module in ../rds-json-nginx-module-0.14
 + ngx_http_rds_json_filter_module was configured
adding module in ../rds-csv-nginx-module-0.06
 + ngx_http_rds_csv_filter_module was configured
checking for PCRE library ... found
checking for PCRE JIT support ... found
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.
ERROR: failed to run command: sh ./configure --prefix=/usr/local/Cellar/ngx_openresty/1.7.10.2/nginx \...
READ THIS: https://git.io/brew-troubleshooting
If reporting this issue please do so at (not Homebrew/homebrew):
  https://github.com/killercup/homebrew-openresty/issues

This is on OS-X, and OpenSSL appears to be installed:

$ openssl version
OpenSSL 0.9.8zg 14 July 2015

brew list shows openssl in the results as well.

A different mac in our group did not encounter this problem and installed openresty just fine, so it is unclear what dependency might be missing.

rlamorea commented 9 years ago

I think I found the culprit here. We're seeing that those members of our group that updated to El Capitan encounter this problem. It seems like the default openssl (i.e. /usr/bin/openssl) does not have the development libraries.

The workaround is to brew install openssl and then brew link --force openssl. This switches openssl to /usr/local/bin/openssl and the openresty install works fine.

rlamorea commented 9 years ago

Better error handling on this would be nice, though.

mikz commented 9 years ago

ngx_openresty then should depend on openssl (keg only) on el capitan

timotgl commented 8 years ago

The workaround described by @rlamorea doesn't work for me:

$ brew link --force openssl
Warning: Refusing to link: openssl
Linking keg-only openssl means you may end up linking against the insecure,
deprecated system OpenSSL while using the headers from Homebrew's openssl.
Instead, pass the full include/library paths to your compiler e.g.:
  -I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib

I seem to still have the system OpenSSL installed?

$ openssl version
OpenSSL 0.9.8zh 14 Jan 2016

Any ideas?

mikz commented 8 years ago

I moved to https://github.com/Homebrew/homebrew-nginx/blob/master/Formula/openresty.rb which is copy of this formula. It has openssl dependency.

timotgl commented 8 years ago

thanks @mikz this finally worked for me!

devender commented 7 years ago

FYI this worked for me http://stackoverflow.com/questions/32960032/nginx-cannot-find-openssl-development-headers

marutiprasad commented 7 years ago

same issue on mac mac os sierra. The brew force linking is also not working.


Warning: Refusing to link: openssl
Linking keg-only openssl means you may end up linking against the insecure,
deprecated system OpenSSL while using the headers from Homebrew's openssl.
Instead, pass the full include/library paths to your compiler e.g.:
  -I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib
xyoun commented 7 years ago

use the official repo can resolve it: brew install homebrew/nginx/openresty this one is out dated.

killercup commented 7 years ago

Oh, there's an official formula now? Is there a way to mark this tap/formula as deprecated?