How to install luasql on Linux Ubuntu 16?

Thanks to the help of the StackOverflow community, I was able to correctly install luasql on my Linux CentOS 7 computer .

Now I have a similar problem with Linux Ubuntu 16. I tried the following commands:

sudo apt-get -y install lua-sql-postgres
sudo apt-get -y install lua-sql-postgres-dev
sudo luarocks install luasql-postgres

And here is the error I get from the system:

Installing https://rocks.moonscript.org/luasql-postgres-2.3.5-2.rockspec...
Using https://rocks.moonscript.org/luasql-postgres-2.3.5-2.rockspec... switching to 'build' mode

Error: Could not find expected file libpq-fe.h, or libpq-fe.h for PGSQL -- 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

Does anyone know how to solve this problem? Thanks

+6
source share
2 answers

As suggested by @Knud Larsen:

First you need to install libpq-dev.

If it was successfully installed, you can see the file /usr/include/postgresql/libpq-fe.h

After that, run the command:

sudo luarocks PGSQL_INCDIR=/usr/include/postgresql/ install luasql-postgres
+6
source

, libpq-dev:

libpq-fe.h /usr/include/postgresql/ http://packages.ubuntu.com/xenial-updates/amd64/libpq-dev/filelist

+1

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


All Articles