2013-02-13 26 views
0

我跑bundle update(這樣我就可以安裝導軌)安裝PG(0.14.1),但得到這個錯誤:「捆綁更新」無法以原生擴展

$ bundle update 
..... < other stuff ....> 
Installing pg (0.14.1) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 

     /Users/user/.rvm/rubies/ruby-1.9.3-p374/bin/ruby extconf.rb 
checking for pg_config... no 
No pg_config... trying anyway. If building fails, please try again with 
--with-pg-config=/path/to/pg_config 
checking for libpq-fe.h... no 
Can't find the 'libpq-fe.h header 
*** extconf.rb failed *** 
Could not create Makefile due to some reason, probably lack of 
necessary libraries and/or headers. Check the mkmf.log file for more 
details. You may need configuration options. 

我是新來Ruby和所有這些,誰能告訴我這裏有什麼問題? 這是在OSX

+0

知道你在這裏運行的是什麼操作系統是非常重要的。 – 2013-02-13 19:01:36

+0

這是OSX(如'/ Users/user/...'應該建議的路徑) – user1508893 2013-02-13 19:03:46

+0

看起來你缺少postgres-dev文件,並且在你的gem文件中有一個需要它的gem。 – winglerw28 2013-02-13 19:06:12

回答

2

確保ton安裝postgres第一。我建議你通過Mac軟件包管理器homebrew這樣做。

brew install postgresql 

Here is one關於如何在Mac上安裝postgres的許多教程。

編輯

看起來像寶石找不到你的Postgres的配置,這裏是類似於您的問題的答案:

https://stackoverflow.com/a/9669523/277370

+0

'postgres'和'posgresSQL'一樣嗎?我的機器上有PSQL,如果那是你要求的? – user1508893 2013-02-13 19:05:17

+0

你能在終端中運行psql或createuser命令嗎? – allaire 2013-02-13 19:06:13

+0

那麼,我有PSQL接口(與其他數據庫服務器交談,不一定是PSQL服務器)。 'psql'在我的路徑中。所以我可以在終端上輸入'psql'而不會發現'命令沒有找到' – user1508893 2013-02-13 19:07:04