0

我真的对正在发生的事情感到茫然:

当我尝试 gem install pg 时:

gem install pg
Building native extensions.  This could take a while...
ERROR:  Error installing pg:
    ERROR: Failed to build gem native extension.

    /Users/user/.rvm/rubies/ruby-2.0.0-p247/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 PG_DIAG_TABLE_NAME 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 "DESTDIR="
compiling gvl_wrappers.c
compiling pg.c
pg.c: In function ‘pg_s_library_version’:
pg.c:272: warning: implicit declaration of function ‘PQlibVersion’
pg.c: In function ‘Init_pg_ext’:
pg.c:375: error: ‘PQPING_OK’ undeclared (first use in this function)
pg.c:375: error: (Each undeclared identifier is reported only once
pg.c:375: error: for each function it appears in.)
pg.c:377: error: ‘PQPING_REJECT’ undeclared (first use in this function)
pg.c:379: error: ‘PQPING_NO_RESPONSE’ undeclared (first use in this function)
pg.c:381: error: ‘PQPING_NO_ATTEMPT’ undeclared (first use in this function)
make: *** [pg.o] Error 1


Gem files will remain installed in /Users/user/.rvm/gems/ruby-2.0.0-p247/gems/pg-0.16.0 for inspection.
Results logged to /Users/user/.rvm/gems/ruby-2.0.0-p247/gems/pg-0.16.0/ext/gem_make.out

这是我的第一个 rails 4 应用程序(这台计算机上的所有其他应用程序都是 3.2),刚刚升级到 ruby​​ 2.0.0,这一切都适用于以前的版本..

4

2 回答 2

0

解决问题的步骤在https://gist.github.com/caike/6148957

于 2013-08-13T23:25:56.060 回答
0

因此,在找到这个答案后 - Mountain Lion 上的 pg gem '0.14.0' 失败了,这似乎是因为我最初安装 postgreSQL 的方式是通过一键安装程序,在通过自制软件安装后,一切似乎都运行良好。

于 2013-08-13T23:37:03.877 回答