2013-03-17 4 views
0

Я разрабатываю приложение для рельсов, чтобы нажать на Heroku в Mac OS X, и когда я пытаюсь запустить «gem install pg», я получаю следующие ошибки.postgresql 9.1 - Rails 3 - не удается установить pg gem

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-p194/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 rb_encdb_alias()... yes 
checking for rb_enc_alias()... 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 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-p194/gems/pg-0.14.1 for inspection. 
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p194/gems/pg-0.14.1/ext/gem_make.out 

Я установил Postgres, используя установщик Mac OS X со своего веб-сайта.

Любая помощь в том, как исправить это, было бы очень полезно!

+0

Удалите только что установленные postgres (с их сайта) и вместо этого установите его с помощью homebrew: 'brew install postgresql', а затем попробуйте установить pg gem снова. – fmendez

ответ

1

Если вы устанавливаете Postgres, используя Brew, эта проблема не будет возникать.

Смежные вопросы