我尝试使用以下命令在我的Linux CentOS 7计算机上安装CentOS:
luarocks install 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,但我没有任何改进.
我该怎么办?
发布于 2017-04-02 20:01:07
这其中的Lua位很好;您所得到的错误是C位不存在。
通常,当您与C库进行接口时,需要确保安装了C库的-dev (用于Debianish)或-devel (用于Redhatish)包。
在您的情况下,您可能只需在方框中以根用户的形式执行以下操作:
yum install postgresql-devel然后,...and再次尝试您的luarocks安装。
或者,您可以尝试OS本机包,而不是:
yum install lua-sql-postgresql我个人更喜欢为稳定的Lua库使用操作系统包,但是这是你的决定.
https://stackoverflow.com/questions/43149280
复制相似问题