2013-04-01 115 views
2
checking for libpq-fe.h... *** extconf.rb failed *** 

似乎是這個問題,從這個尾巴是:缺少PG頭(要安裝的Postgres寶石與釀造Rails)的

ERROR: Error installing pg: 
    ERROR: Failed to build gem native extension. 

     /Users/elephanttrip/.rvm/rubies/ruby-1.9.2-p320/bin/ruby extconf.rb 
checking for pg_config... yes 
Using config values from /usr/local/bin/pg_config 
checking for libpq-fe.h... *** 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. 

我的步驟來重現這個對山獅的Mac OS是:

  1. brew install postgresql
  2. env ARCHFLAGS="-arch x86_64" gem install pg

我試着通過我的電腦查明不同的pg_config。 Brew的地窖裏有一個,Brew的那個到/user/local,另一個可能來自之前的下載。他們都沒有工作。

UPDATE

只是試圖安裝沒有配置選項。並得到了一個笑:

ruby extconf.rb --without-pg-config 
checking for pg_config... yes 
+0

您是否在'brew unlink'中創建並卸載了所有版本? – gmaliar

+0

是的,我做到了。我開始認爲這可能是一個rvm問題。 – Trip

回答

2

我開始想象我的問題有一些與RVM做,因爲它說的跟蹤底部..:

"You need to download development tools" 

然後我做:

$ rvm autolibs enable 
$ rvm requirements 

然後,我繼續前進,只是更新我的紅寶石(如果你不這樣做,那麼我建議你只是重新安裝它你現在的。我不能這樣做沒有autolibs enable):

$ rvm install ruby-2.0.0-p0 

熱潮!解決了!!!! (:D :D :D :D :D) x 1,000,000