Unwinding macports to use Apple’s ruby stack I found that
sudo port install postgresql82 postgresql82-server
fails. Able to install from source with the same configuration settings. Missing optional stuff like tsearch2 though.

More of a concern is the problems installing
sudo gem install ruby-postgres. The first problem is that configure doesn’t find certain functions due to problems linking to the ppc symbols. The ARCHFLAGS="-arch i386" doesn’t solve this - still builds for ppc as well. Can override #defines in the postgres.c file and override the contents of the Makefile to build successfully though.

Update ARCHFLAGS does work in compiling ruby-postgres, I just had to be more sophisticated about passing it through sudo.

6 Responses to “Problems installing postgres and ruby-postgres after Leopard upgrade”

  1. alilee Says:

    This bug here covers the postgresql82 macports issue: http://trac.macports.org/projects/macports/ticket/12994

  2. Jeff Dean Says:

    What was the final sudo command you ran to get it to work?

  3. Russ Brooks Says:

    Here is the answer! There is a much easier way to install PostgreSQL on Leopard, without compiling yourself or using the MacPort.
    http://www2.russbrooks.com:8080/2007/11/4/install-postgresql-on-mac-os-x-10-5-leopard

  4. Jason Jones Says:

    Jeff: The command should look something like this:

    sudo env ARCHFLAGS=”-arch i386″ gem install ruby-postgres

  5. Tim Harrison Says:

    Thanks Jason. That command saved me.

  6. schroedi Says:

    Thank you for the tutorital, but in my case it wont work so….. I got a compilation error during the make session… ;-O

Leave a Reply