Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Linux CentOS 7上安装luasql?_Linux_Postgresql_Lua_Centos7_Torch - Fatal编程技术网

如何在Linux CentOS 7上安装luasql?

如何在Linux CentOS 7上安装luasql?,linux,postgresql,lua,centos7,torch,Linux,Postgresql,Lua,Centos7,Torch,我尝试使用以下命令在Linux CentOS 7计算机上安装: luarock安装luasql postgres 但不幸的是,我犯了以下错误: Installing https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/luasql-postgres-2.3.5-2.rockspec... Using https://raw.githubusercontent.com/rocks-moonsc

我尝试使用以下命令在Linux CentOS 7计算机上安装:

luarock安装luasql postgres

但不幸的是,我犯了以下错误:

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
然后我尝试运行最后一行
luarocks install luasql postgres PGSQL_DIR=/usr/local
,但没有任何改进


我该怎么办呢?

这个Lua部分很好;您得到的错误是C位不存在

通常,当您与C库交互时,需要确保已安装C库的-dev(用于Debianish)或-devel(用于Redhatish)包

在您的情况下,您可能只需在方框上以root用户身份执行以下操作:

yum install postgresql-devel
…然后再次尝试安装Luarock

或者,您可以尝试使用OS本机软件包:

yum install lua-sql-postgresql

我个人更喜欢使用操作系统包实现稳定的Lua LIB,这些Lua LIB变化不大,但这是您的决定……

那么,您是否100%确定您的计算机中有一个正在运行的pgsql实例?谢谢!我在Linux Ubuntu上也有同样的问题,你知道如何解决这个问题吗?