Closed ged closed 13 years ago
Original comment by Michael Granger (Bitbucket: ged, GitHub: ged).
Actually the problem with the gem install is a bit further towards the top:
ld: warning: in /Developer/SDKs/MacOSX10.6.sdk/usr/local/lib/libpq.dylib,
file was built for i386 which is not the architecture being linked (x86_64)
Undefined symbols:
"_PQconnectdb", referenced from:
_t in ccxwIhEo.o
If you install an extension for an x86_64 Ruby, you need to link against a library that's of the same architecture. You can check the architecture like so:
$ rvm 1.9.2 ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0]
I installed the PostgreSQL package you linked to, but it put my libpq in /usr/local/pgsql-9.0/lib, not /Developer/SDKs/MacOSX10.6.sdk/usr/local/lib/libpq.dylib, so I'm not sure why pg_config thinks that's what it should be linking against. Is the pg_config returned by which pg_config
/usr/local/pgsql-9.0/bin/pg_config? If not, I suspect you have another i386-only installation hanging around.
To be sure you're linking against the right stuff, try this:
rvm 1.9.2-head gem install pg -- \
--with-pg-config=/usr/local/pgsql-9.0/bin/pg_config
The tip install has the same architecture problem, and links against the same library under /Developer/SDKs.
Original comment by Markus Wein (Bitbucket: nuclearsquid, ).
Yeah, /usr/local/pgsql
is actually a symlink to pgsql-9.0
:
$ which pg_config
/usr/local/pgsql/bin/pg_config
$ ls -l /usr/local/pgsql
lrwxr-xr-x 1 cypher wheel 9B Dec 7 16:41 /usr/local/pgsql@ -> pgsql-9.0
$ pg_config
BINDIR = /usr/local/pgsql-9.0/bin
DOCDIR = /usr/local/pgsql-9.0/share/doc
INCLUDEDIR = /usr/local/pgsql-9.0/include
PKGINCLUDEDIR = /usr/local/pgsql-9.0/include
INCLUDEDIR-SERVER = /usr/local/pgsql-9.0/include/server
LIBDIR = /usr/local/pgsql-9.0/lib
PKGLIBDIR = /usr/local/pgsql-9.0/lib
LOCALEDIR =
MANDIR = /usr/local/pgsql-9.0/man
SHAREDIR = /usr/local/pgsql-9.0/share
SYSCONFDIR = /usr/local/pgsql-9.0/etc
PGXS = /usr/local/pgsql-9.0/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--with-openssl' '--with-pam' '--with-krb5' '--with-gssapi' '--with-ldap' '--enable-thread-safety' '--with-bonjour' '--with-python' '--without-perl' '--enable-nls' '--with-libxml' 'CFLAGS=-Os -arch i386 -arch x86_64 -D_FILE_OFFSET_BITS=64' 'LD=gcc -arch i386 -arch x86_64 -nostdlib'
CC = gcc
CPPFLAGS = -I/usr/include/libxml2
CFLAGS = -Os -arch i386 -arch x86_64 -D_FILE_OFFSET_BITS=64 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fwrapv
CFLAGS_SL =
LDFLAGS = -arch i386 -arch x86_64
LDFLAGS_SL =
LIBS = -lintl -liconv -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lldap -lreadline -lz
VERSION = PostgreSQL 9.0.1
It turns out that /Developer/SDKs/MacOSX10.6.sdk/usr/local/lib
is actually a symlink to /usr/local/lib
, where, for some reason, I had an older version of libpq installed. Moving it to a backup directory solved my problem, and I was able to install the pg
gem just fine.
Original report by Markus Wein (Bitbucket: nuclearsquid, ).
Using the following command to install pg:
I get the following output:
If you'll take a look at the attached mkmf.log-gem, it complains about too few arguments to PQconnectdb, not that it doesn't exist.
I've installed PostgreSQL 9.0 using the package provided here: http://www.kyngchaos.com/software/postgres
I also tried building using the latest version from BitBucket (89348c8bb6d1) to try the new minimal extconf.rb, and got the following:
mkmf.log-tip is attached.