首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Linux CentOS 7上安装luasql?

如何在Linux CentOS 7上安装luasql?
EN

Stack Overflow用户
提问于 2017-03-31 20:36:46
回答 1查看 889关注 0票数 1

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

luarocks install luasql-postgres

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

代码语言:javascript
复制
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,但我没有任何改进.

我该怎么办?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-04-02 20:01:07

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

通常,当您与C库进行接口时,需要确保安装了C库的-dev (用于Debianish)或-devel (用于Redhatish)包。

在您的情况下,您可能只需在方框中以根用户的形式执行以下操作:

代码语言:javascript
复制
yum install postgresql-devel

然后,...and再次尝试您的luarocks安装。

或者,您可以尝试OS本机包,而不是:

代码语言:javascript
复制
yum install lua-sql-postgresql

我个人更喜欢为稳定的Lua库使用操作系统包,但是这是你的决定.

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43149280

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档