【问题标题】:How to install luasql on Linux CentOS 7?如何在 Linux CentOS 7 上安装 luasql?
【发布时间】:2017-08-26 05:35:36
【问题描述】:

我尝试使用以下命令在我的 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 但我没有任何改进...

我该怎么办?

【问题讨论】:

  • 那么,您是否 100% 确定您的机器中有一个启动并正在运行的 pgsql 实例?

标签: linux postgresql lua centos7 torch


【解决方案1】:

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

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

在你的情况下,你可以在你的盒子上以 root 身份执行以下操作:

yum install postgresql-devel

...然后再次尝试安装 luarocks。

或者,您可以尝试使用操作系统原生包:

yum install lua-sql-postgresql

我个人更喜欢将 OS 包用于变化不大的稳定 Lua 库,但这是您的决定...

【讨论】:

  • 谢谢!我在 Linux Ubuntu 上遇到了同样的问题,你知道如何解决那里的问题吗?
猜你喜欢
  • 1970-01-01
  • 2017-08-28
  • 2020-09-23
  • 1970-01-01
  • 1970-01-01
  • 2018-11-13
  • 2018-05-28
  • 2023-03-22
  • 2019-07-03
相关资源
最近更新 更多