How to install luasql on Linux CentOS 7?

I tried installing luasql on my Linux CentOS 7 computer using this command:

luarocks install luasql-postgres

but unfortunately I got the following error:

Installing https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/luasql-postgres-2.3.5-2.rockspec...
Using https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/luasql-postgres-2.3.5-2.rockspec... switching to 'build' mode

Error: Could not find header file for PGSQL
  No file libpq-fe.h in /usr/local/include
  No file libpq-fe.h in /usr/include
You may have to install PGSQL in your system and/or pass PGSQL_DIR or PGSQL_INCDIR to the luarocks command.
Example: luarocks install luasql-postgres PGSQL_DIR=/usr/local

I tried to run the last line luarocks install luasql-postgres PGSQL_DIR=/usr/local, but I had no improvement ...

What should I do?

+1
source share
1 answer

The lua bits of this are beautiful; The error you get is that the C bit does not exist.

In general, when you interact with the C library, you should make sure that you have the C -dev (for Debianish) or -devel (for Redhatish) packages installed.

root:

yum install postgresql-devel

... luarocks.

:

yum install lua-sql-postgresql

Lua-, , ...

+1

Source: https://habr.com/ru/post/1016284/


All Articles