Crypt-SSLeay on a macbook

perl

I'm trying to install Crypt-SSLeay on a macbook and it failed.

I manually downloaded Crypt-SSLeay from cpan and issued:

 perl Makefile.pl

The error is

openssl-version.c:2:10: fatal error: 'openssl/opensslv.h' file not found
#include <openssl/opensslv.h>
     ^
1 error generated.
Failed to build and link a simple executable using OpenSSL

The file exists and it's located at:

 /usr/local/opt/openssl/include/openssl

How do I go about fixing this, thanks.

Best Answer

Well, after trying other solutions of this and other threads to no avail, I stumbled upon this one-liner that did the trick for me:

$ sudo OPENSSL_INCLUDE=/usr/local/opt/openssl/include OPENSSL_LIB=/usr/local/opt/openssl/lib PERL_MM_USE_DEFAULT=1 perl -MCPAN -e "install Crypt::SSLeay"