1

I am trying to install Luasec on Ubuntu terminal, but it just keeps displaying this error to me:

Error: Could not find header file for OPENSSL
   No file openssl/ssl.h in /usr/local/include
   No file openssl.h/ssl.h/ in /usr/include
   No file openssl/ssl.h in /include
You may have to install OPENSSL in your system and/or pass OPENSSL_DIR or OPENSSL_INCDIR to the luarocks command.

When I check OpenSSL version it says its 1.1.1f

enter image description here

So how do I proceed?

Joohane
  • 49
  • 1
  • 5

4 Answers4

1
sudo apt -y install libssl-dev
cottontail
  • 10,268
  • 18
  • 50
  • 51
anmg
  • 11
  • 3
0

I don't think any of the mentioned answers solves the problem. Hence sharing what worked for me.

OS: macOS Ventura

Before running this command, I had lua and openssl (brew install openssl) installed.

What you need to figure out is the path for these two. Start looking them inside /usr/local/Cellular folder and update in below format:

luarocks --lua-dir /usr/local/Cellar/lua/5.4.4_1/ install luasec OPENSSL_DIR=/usr/local/Cellar/openssl@1.1/1.1.1t

This way we are explicitly telling the command where the required directory are.

Rahul Gandhi
  • 1,035
  • 1
  • 11
  • 24
-1

Despite the lowercase l this solution works for me (independent of what some responders told here)

luarocks install openssl

-4

Fixed the issue by Installing OpenSSL with terminal through Luarocks with the command:

Luarocks install openssl

And now after installing it, it works.

Joohane
  • 49
  • 1
  • 5
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 04 '22 at 16:14
  • This answer isn't unclear, it's plain wrong. First of all the `luarocks` command should probably be using a lowercase `l`. **Second, there is no `openssl` package on Luarocks.** Third, SSL-related packages on Luarocks (such as `luaossl`) appear to just be bindings to `openssl`. – Luatic Apr 28 '22 at 10:21