Not sure if this will help, but I see an inconsistency in your 2 output listings: You mentioned that you installed the postgresql using the Mac installer package. Their instructions say that it installs into / Library/PostgreSQL/8.4
presumably all of the lib, bin, data and other supporting files are also installed at under this path. However, the output from your latest pg gem build is showing: -I/usr/local/pgsql/include It looks like in the earlier post, you explicitly change your path and specify the include dirs to point to the /Library installation, and the output reflects those paths. However in this latest attempt, it is picking up something in /usr/local I suppose if you have an old/incompatible version of postgresql installed in /usr/local that might be causing a problem maybe check the output of: /usr/local/bin/pg_config and /Library/PostgreSQL/8.4/bin/pg_config Try removing or renaming /usr/local/bin/pg_config so that it won't be found. You might also want to cleanup any old files in /usr/local/ include (i.e. maybe compat.h is being picked up from there?) and /usr/ local/lib Also, double-check that: lipo -info /Library/PostgreSQL/8.4/bin/pg_config is a fat 32/64 bit version, but it probably is... Brian On Feb 11, 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
