【问题标题】:How to install luasql on Linux Ubuntu 16?如何在 Linux Ubuntu 16 上安装 luasql?
【发布时间】:2017-08-28 15:14:40
【问题描述】:

感谢 StackOverflow 社区的帮助,我能够在我的 computer running Linux CentOS 7 上正确安装 luasql。

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

sudo apt-get -y install lua-sql-postgres
sudo apt-get -y install lua-sql-postgres-dev
sudo 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' mode

Error: 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

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

【问题讨论】:

标签: linux postgresql ubuntu lua torch


【解决方案1】:

正如@Knud Larsen 所建议的那样:

首先,你需要安装libpq-dev

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

然后执行命令:

sudo luarocks PGSQL_INCDIR=/usr/include/postgresql/ install luasql-postgres

【讨论】:

    【解决方案2】:

    请安装包libpq-dev

    文件libpq-fe.h/usr/include/postgresql/http://packages.ubuntu.com/xenial-updates/amd64/libpq-dev/filelist

    【讨论】:

    • 谢谢。我安装了libpq-dev,但没有任何改变……还有其他想法吗?
    猜你喜欢
    • 2015-12-16
    • 2017-08-26
    • 1970-01-01
    • 2017-01-04
    • 2013-01-25
    • 1970-01-01
    • 2017-12-08
    • 2015-07-14
    • 1970-01-01
    相关资源
    最近更新 更多