简体   繁体   中英

How to install luarocks in Cent OS?

I tried to install luarocks in Cent OS. After ./configure command I get error:

Lua interpreter found: /bin/lua...
Lua version detected: 5.1
lua found in $PATH: /bin
Checking Lua includes... lua.h not found (looked in //include, //include/lua/5.1, //include/lua5.1)
You may want to use the flag --with-lua or --with-lua-include. See --help.

As I understand correctly, at first I need install Lua and specify path to Lua when configure luarocks

Having the Lua interpreter in /bin (and not /usr/bin ) seems unusual.

Do you have the file lua.h installed somewhere? (In other words, did you install the Lua development headers?) You should be able to find it using the locate command:

locate lua.h

If you do have lua.h (for example, in /usr/include ), tell the configure script where this file is located, just like the error message is suggesting you:

./configure --with-lua-include=/usr/include

You need to make sure you know your lua version and then locate the header files.

for checking you lua version just type:

lua -v

I had to install both lua and lua-devel(for the lua.h headers)

sudo dnf install lua lua-devel

then I update plocate database to search for the header files:

updatedb
plocate lua.h

the command returned

/usr/include/lua.h
/usr/include/lua.hpp

The second problem installing it was the versions, the default looks for 5.1 but the dnf installed lua 5.4, so I had to specify the version:

./configure --lua-version=5.4 --with-lua-include=/usr/local/include

Then it worked.

In my case when I tried to install lua and luarocks from dnf I got the error ( I am using fedora workstation 36):

Error: Failed finding Lua header files. You may need to install them or configure LUA_INCDIR.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM