如何在Linux Ubuntu 16上安装luasql?

如何在Linux Ubuntu 16上安装luasql?,第1张

概述感谢StackOverflow社区的帮助,我能够在我的 computer running Linux CentOS 7上正确安装luasql. 现在我在Linux Ubuntu 16上遇到了类似的问题. 我尝试了以下命令: sudo apt-get -y install lua-sql-postgressudo apt-get -y install lua-sql-postgres-devsu 感谢StackOverflow社区的帮助,我能够在我的 computer running Linux CentOS 7上正确安装luasql.

现在我在linux Ubuntu 16上遇到了类似的问题.
我尝试了以下命令:

sudo apt-get -y install lua-sql-postgressudo apt-get -y install lua-sql-postgres-devsudo luarocks install luasql-postgres

这是我从系统得到的错误:

Installing https://rocks.MoonScript.org/luasql-postgres-2.3.5-2.rockspec...Using https://rocks.MoonScript.org/luasql-postgres-2.3.5-2.rockspec... switching to 'build' modeError: Could not find expected file libpq-fe.h,or libpq-fe.h for PGsql -- 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

有谁知道如何解决这个问题?
谢谢

解决方法 正如@Knud larsen所建议的那样:

首先,您需要安装libpq-dev.

如果安装成功,您可以看到文件/usr/include/postgresql/libpq-fe.h

之后执行命令:

sudo luarocks PGsql_INCDIR=/usr/include/postgresql/ install luasql-postgres
总结

以上是内存溢出为你收集整理的如何在Linux Ubuntu 16上安装luasql?全部内容,希望文章能够帮你解决如何在Linux Ubuntu 16上安装luasql?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/1049113.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-25
下一篇 2022-05-25

发表评论

登录后才能评论

评论列表(0条)

保存