It looks like the version of postgresql is a universal binary (32-bit and 64-bit) while ruby is 64-bit only. I suppose it's possible this mismatch is causing a problem. I might try one of the following next:
1. Try rebuilding the ruby-pg gem with ARCHFLAGS="-arch x86_64" in your environment. 2. Try rebuilding postgresql with ARCHFLAGS="-arch x86_64" (to produce a 64-bit only binary) and then try rebuilding ruby-pg. -John On Thu, Feb 11, 2010 at 10:26 PM, Gisborne <[email protected]> wrote: > Thanks for the help. But sadly, after I installed a 64 bit build of > Postgres, nothing has changed: > > bash-3.2# file $(which ruby) > /usr/local/bin/ruby: Mach-O 64-bit executable x86_64 > bash-3.2# file $(which pg_config) > /usr/local/pgsql/bin/pg_config: Mach-O universal binary with 2 > architectures > /usr/local/pgsql/bin/pg_config (for architecture i386): Mach-O > executable i386 > /usr/local/pgsql/bin/pg_config (for architecture x86_64): Mach-O 64- > bit executable x86_64 > bash-3.2# sudo gem install pg > Building native extensions. This could take a while... > ERROR: Error installing pg: > ERROR: Failed to build gem native extension. > > /usr/local/bin/ruby extconf.rb > checking for main() in -lpq... yes > checking for libpq-fe.h... yes > checking for libpq/libpq-fs.h... yes > checking for PQconnectionUsedPassword()... no > checking for PQisthreadsafe()... no > checking for PQprepare()... no > checking for PQexecParams()... no > checking for PQescapeString()... no > checking for PQescapeStringConn()... no > checking for lo_create()... no > checking for pg_encoding_to_char()... no > checking for PQsetClientEncoding()... no > creating Makefile > > make > gcc -I. -I. -I/usr/local/lib/ruby/1.8/i686-darwin10.2.0 -I. - > DHAVE_LIBPQ_FE_H -DHAVE_LIBPQ_LIBPQ_FS_H -I/usr/local/pgsql/include - > D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -D_XOPEN_SOURCE=1 - > fno-common -pipe -fno-common -c compat.c > In file included from compat.c:16: > compat.h:38:2: error: #error PostgreSQL client version too old, > requires 7.3 or later. > > > On Feb 11, 4:03 pm, John Parker <[email protected]> wrote: >> As a sanity check have you checked the that ruby and postgresql are >> either both 32-bit or both 64-bit? What do you get if you run the >> following? >> >> $ file $(which ruby) >> $ file $(which pg_config) >> >> I encountered the exact same error messages as you a few months ago. I >> had installed postgresql via MacPorts, and, like Darren, I was using a >> version of ruby installed via rvm. It turned I had built a 32-bit >> version of ruby, but the version of postgresql I had installed was >> 64-bit (the above "file" incantations revealed this to me). After >> rebuilding ruby with ARCHFLAGS="-arch x86_64" I was able to build the >> ruby-pg gem. > > -- > SD Ruby mailing list > [email protected] > http://groups.google.com/group/sdruby > -- John Parker [email protected] -- SD Ruby mailing list [email protected] http://groups.google.com/group/sdruby
