luaopensslluarockslapis

luarocks package installer could not find header file for CRYPTO (crypto.h)


I am trying to install lapis through luarocks. When I run luarocks install lapis, the terminal returns this error:

Warning: falling back to wget - install luasec to get native HTTPS support
Installing https://luarocks.org/lapis-1.9.0-1.src.rock
Missing dependencies for lapis 1.9.0-1:
   luaossl (not installed)
   pgmoon (not installed)

lapis 1.9.0-1 depends on lua (5.4-1 provided by VM)
lapis 1.9.0-1 depends on ansicolors (1.0.2-3 installed)
lapis 1.9.0-1 depends on date (2.2-2 installed)
lapis 1.9.0-1 depends on etlua (1.3.0-1 installed)
lapis 1.9.0-1 depends on loadkit (1.1.0-1 installed)
lapis 1.9.0-1 depends on lpeg (1.0.2-1 installed)
lapis 1.9.0-1 depends on lua-cjson (2.1.0-1 installed)
lapis 1.9.0-1 depends on luaossl (not installed)
Installing https://luarocks.org/luaossl-20220711-0.src.rock

Error: Failed installing dependency: https://luarocks.org/luaossl-20220711-0.src.rock - Could not find header file for CRYPTO
  No file openssl/crypto.h in /usr/local/include
  No file openssl/crypto.h in /usr/include
  No file openssl/crypto.h in /include
  No file openssl/crypto.h in /usr/local/opt/include
You may have to install CRYPTO in your system and/or pass CRYPTO_DIR or CRYPTO_INCDIR to the luarocks command.
Example: luarocks install luaossl CRYPTO_DIR=/usr/local

I have openssl installed (I am on apple silicone). To install openssl, I just cloned the git repo and then ran:

./Configure

make

make test

As stipulated in the INSTALL.MD file. I think this is an issue a few others have had but there are no answers on how to solve it.


Solution

  • You only followed the instructions in the "Building OpenSSL" section of INSTALL.MD. You skipped the ones in the "Installing OpenSSL" section, so it's not actually installed. Follow them too and then try again.