Gem ERROR: Error installing pg 求助

levan · 2012年09月25日 · 最后由 leozwa 回复于 2012年09月25日 · 3645 次阅读

请问这个该怎么解决?

levantekiMac-mini:catarse levan$ gem install pg -v '0.14.0'
Building native extensions.  This could take a while...
ERROR:  Error installing pg:
    ERROR: Failed to build gem native extension.

        /Users/levan/.rvm/rubies/ruby-1.9.2-p320/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()... yes
checking for PGRES_COPY_BOTH 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
/usr/bin/gcc-4.2 -I. -I/Users/levan/.rvm/rubies/ruby-1.9.2-p320/include/ruby-1.9.1/x86_64-darwin12.1.0 -I/Users/levan/.rvm/rubies/ruby-1.9.2-p320/include/ruby-1.9.1/ruby/backward -I/Users/levan/.rvm/rubies/ruby-1.9.2-p320/include/ruby-1.9.1 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/Users/levan/.rvm/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -I/usr/include -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long  -fno-common -pipe  -o pg.o -c 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 /Users/levan/.rvm/gems/ruby-1.9.2-p320@catarse/gems/pg-0.14.0 for inspection.
Results logged to /Users/levan/.rvm/gems/ruby-1.9.2-p320@catarse/gems/pg-0.14.0/ext/gem_make.out
需要 登录 后方可回复, 如果你还没有账号请 注册新账号