2014-10-05 209 views
1

我走的建議本頁面爲Mac從源代碼編譯的Lua-DBI:如何在Mac OS X上安裝的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. 

我是一個noob。感謝任何幫助。

回答

1

你可以得到LuaDBI,而無需在Mac OS X上使用LuaRocksluarocks install luadbi-mysql(對於MYSQL)和luarocks install luasql-postgres(對於Postgres)的源代碼構建它。

Luarocks本身可以安裝在Mac上使用HomeBrew如下:

brew update 
brew install luarocks 

欲瞭解更多信息,請參閱the LuaRocks github repo