Can't install 0.14.1 on OSX Lion

39 views
Skip to first unread message

Jack Royal-Gordon

unread,
Dec 17, 2012, 7:36:20 PM12/17/12
to rub...@googlegroups.com
Installing 0.13.2 works fine.  BTW I'm using RBENV and Ruby 1.9.2-p290.  Attempting to install 0.14.1 (I used bundle but also got the error with gem install) produces the following output:

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

        /Users/jackrg/.rbenv/versions/1.9.2-p290/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 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
/usr/bin/gcc-4.2 -I. -I/Users/jackrg/.rbenv/versions/1.9.2-p290/include/ruby-1.9.1/x86_64-darwin11.3.0 -I/Users/jackrg/.rbenv/versions/1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/Users/jackrg/.rbenv/versions/1.9.2-p290/include/ruby-1.9.1 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I'/Users/jackrg/.rbenv/versions/1.9.2-p290/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  -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/jackrg/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/pg-0.14.1 for inspection.
Results logged to /Users/jackrg/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/pg-0.14.1/ext/gem_make.out
An error occured while installing pg (0.14.1), and Bundler cannot continue.
Make sure that `gem install pg -v '0.14.1'` succeeds before bundling.

Lars Kanis

unread,
Dec 18, 2012, 3:47:03 AM12/18/12
to rub...@googlegroups.com

Hi Jack,

without deeper looking, it seems that the versions of libpq library and header files (pointed to by pg_config) are different. pg-0.14 makes use of some new functions provided by your libpq version, that seems to be no available in the header files.

Regards,
Lars

--
You received this message because you are subscribed to the Google Groups "ruby-pg" group.
To post to this group, send email to rub...@googlegroups.com.
To unsubscribe from this group, send email to ruby-pg+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/ruby-pg/-/eIbIpSOUt6kJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jack Royal-Gordon

unread,
Oct 12, 2020, 6:46:55 PM10/12/20
to ruby-pg
Hi Lars,

Thanks for your response. Actually, while that appeared to be the problem it really wasn't. What actually happened is one of the Clang defaults changed after the gem was released (not surprising as it's been several years), so you have to add -- --with-cflags="-Wno-error=implicit-function-declaration to the gem install command. This seems to be the case with a number of older gems, as it was also true with pg 0.15.1 and Nokogiri 1.6.7.2.

Reply all
Reply to author
Forward
0 new messages