如何在Mac OS X上安装Lua DBI?

我正在遵循这个页面上的建议,从源代码中编译 Lua-DBI:

http://prosody.im/doc/depends#luadbi

但是我不知道如何从源代码中编译它。我得到以下错误。

make psql
gcc -c -o build/dbd_postgresql_main.o dbd/postgresql/main.c -g -pedantic -Wall -O2 -shared -fpic -I /usr/include/lua5.1 -I /usr/include/mysql -I /usr/include/postgresql/ -I /opt/ibm/db2exc/V9.5/include/ -I /usr/lib/oracle/xe/app/oracle/product/10.2.0/client/rdbms/public/ -I .
clang: warning: argument unused during compilation: '-shared'
In file included from dbd/postgresql/main.c:1:
dbd/postgresql/dbd_postgresql.h:1:10: fatal error: 'libpq-fe.h' file not found
#include <libpq-fe.h>
         ^
1 error generated.

我是新手。感谢任何帮助。

点赞
用户2750819
用户2750819

在 Mac OS X 上,您可以通过 LuaRocks 获得 LuaDBI 而无需从源代码构建: luarocks install luadbi-mysql(适用于MYSQL)和 luarocks install luasql-postgres(适用于Postgres)。

可以使用 HomeBrew 在 Mac 上安装 Luarocks,操作方法如下:

brew update
brew install luarocks

有关更多信息,请参见 the LuaRocks github repo

2015-06-17 09:11:39