2013-04-23 128 views
0

嘗試安裝'pg'時出現以下錯誤任何想法?我很新的軌道,所以我不知道如何解決這個問題。錯誤安裝pg gem

Davids-MacBook-Air:~ DavidStevenson$ install pg 
usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode] 
       [-o owner] file1 file2 
     install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode] 
       [-o owner] file1 ... fileN directory 
     install -d [-v] [-g group] [-m mode] [-o owner] directory ... 
Davids-MacBook-Air:~ DavidStevenson$ gem install pg 
Building native extensions. This could take a while... 
ERROR: Error installing pg: 
    ERROR: Failed to build gem native extension. 

    /usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb 


make 
compiling gvl_wrappers.c 
compiling pg.c 
pg.c: In function ‘Init_pg_ext’: 
pg.c:384: error: ‘PQPING_OK’ undeclared (first use in this function) 
pg.c:384: error: (Each undeclared identifier is reported only once 
pg.c:384: error: for each function it appears in.) 
pg.c:386: error: ‘PQPING_REJECT’ undeclared (first use in this function) 
pg.c:388: error: ‘PQPING_NO_RESPONSE’ undeclared (first use in this function) 
pg.c:390: error: ‘PQPING_NO_ATTEMPT’ undeclared (first use in this function) 
make: *** [pg.o] Error 1 


Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.15.1  for inspection. 
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.15.1/ext/gem_make.out 

回答

1

您可能需要首先安裝postgresql開發庫,使用(homebrew,macports,fink)之一。我個人仍然喜歡macports,但是自制似乎越來越受歡迎。如果仍然不起作用,您可能需要將某些標誌傳遞給「gem install」命令,以告訴它在哪裏找到這些庫。

+0

嘿,這確實是非常感謝! – 2013-04-23 15:03:49

+0

如果我的答案適合你,你會介意將它標記爲Accepted嗎? – sockmonk 2013-04-23 18:53:54