2017-03-31 192 views
1

我試圖用這個命令我的Linux CentOS的7計算機上安裝luasql如何在Linux CentOS 7上安裝luasql?

luarocks install luasql-postgres

但不幸的是我得到了以下錯誤:

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但我沒有改善...

我該怎麼辦?

+0

那麼,你是否100%確定你的機器上有一個正在運行的pgsql實例? – Hackerman

回答

1

這個的Lua位很好;你得到的錯誤是C位不在那裏。一般來說,當你連接一個C庫時,你需要確保你已經安裝了C庫的-dev(用於Debianish)或-devel(用於Redhatish)軟件包。

在你的情況,你可能只是做以下的根在你的盒子:

yum install postgresql-devel 

...然後嘗試你luarocks重新安裝。

或者,你可以嘗試,而不是操作系統原生包:

yum install lua-sql-postgresql 

我個人比較喜歡使用的操作系統軟件包穩定的Lua庫沒有太大變化,但它是你的電話......

+0

謝謝!我在Ubuntu Ubuntu上遇到同樣的問題,你知道如何解決那裏的問題嗎? –