我尝试使用以下命令在我的 Linux CentOS 7 计算机上安装luasql:
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
但没有任何改进......
我应该怎么办?
这个 Lua 位很好;你得到的错误是 C 位不存在。
通常,当您与 C 库交互时,您需要确保安装了 C 库的 -dev(适用于 Debianish)或 -devel(适用于 Redhatish)软件包。
在您的情况下,您可能只需在您的机器上以 root 身份执行以下操作:
yum install postgresql-devel
...然后再次尝试安装 luarocks。
或者,您可以尝试使用操作系统本机包:
yum install lua-sql-postgresql
我个人更喜欢将操作系统包用于稳定的 Lua 库,这些库变化不大,但这是您的要求……
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句