Giter VIP home page Giter VIP logo

Comments (4)

ged avatar ged commented on August 22, 2024

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.

from ruby-pg.

ged avatar ged commented on August 22, 2024

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.

from ruby-pg.

ged avatar ged commented on August 22, 2024

Original comment by Michael Granger (Bitbucket: ged, GitHub: ged).


Ah good news. Thanks for following up!

from ruby-pg.

ged avatar ged commented on August 22, 2024

Original comment by Michael Granger (Bitbucket: ged, GitHub: ged).


Removing component: build-system (automated comment)

from ruby-pg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.