2013-07-06 116 views
0

你好我想,雖然安裝PG寶石每當我捆綁安裝我得到了以下問題PG寶石不安裝

Installing pg (0.15.1) 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 

     /Users/paulmcguane/.rvm/rubies/ruby-1.9.3-p429/bin/ruby extconf.rb 
checking for pg_config... yes 
Using config values from /usr/bin/pg_config 
checking for libpq-fe.h... yes 
checking for libpq/libpq-fs.h... yes 
checking for pg_config_manual.h... yes 
checking for PQconnectdb() in -lpq... yes 
checking for PQconnectionUsedPassword()... yes 
checking for PQisthreadsafe()... yes 
checking for PQprepare()... yes 
checking for PQexecParams()... yes 
checking for PQescapeString()... yes 
checking for PQescapeStringConn()... yes 
checking for PQescapeLiteral()... yes 
checking for PQescapeIdentifier()... yes 
checking for PQgetCancel()... yes 
checking for lo_create()... yes 
checking for pg_encoding_to_char()... yes 
checking for pg_char_to_encoding()... yes 
checking for PQsetClientEncoding()... yes 
checking for PQlibVersion()... yes 
checking for PQping()... yes 
checking for PQsetSingleRowMode()... no 
checking for rb_encdb_alias()... yes 
checking for rb_enc_alias()... no 
checking for rb_thread_call_without_gvl()... yes 
checking for rb_thread_call_with_gvl()... yes 
checking for rb_thread_fd_select()... yes 
checking for rb_w32_wrap_io_handle()... no 
checking for PGRES_COPY_BOTH in libpq-fe.h... no 
checking for PGRES_SINGLE_TUPLE in libpq-fe.h... no 
checking for struct pgNotify.extra in libpq-fe.h... yes 
checking for unistd.h... yes 
checking for ruby/st.h... yes 
creating extconf.h 
creating Makefile 

make 
compiling gvl_wrappers.c 
compiling pg.c 
pg.c: In function ‘pg_s_library_version’: 
pg.c:273: warning: implicit declaration of function ‘PQlibVersion’ 
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 /Users/paulmcguane/.rvm/gems/ruby-1.9.3-p429/gems/pg-0.15.1 for inspection. 
Results logged to /Users/paulmcguane/.rvm/gems/ruby-1.9.3-p429/gems/pg-0.15.1/ext/gem_make.out 

An error occurred while installing pg (0.15.1), and Bundler cannot continue. 
Make sure that `gem install pg -v '0.15.1'` succeeds before bundling. 
+3

閱讀本https://開頭的github .com/PostgresApp/PostgresApp/issues/101 –

+0

@AstDerek,工作治療感謝 –

+0

@AstDerek如果你想張貼您的評論作爲答案虐待接受它。謝謝 –

回答

0

試試這個:

$ env ARCHFLAGS="-arch x86_64" gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/MacOS/bin/pg_config