Installing Postgres on Mac OS X Leopard

Countless tutorials have been written about installing PostgreSQL on Mac OS X Leopard, so I am not going to go in detail. Your best bet is to either build from source or use Macports. But after that all online instructions seemed to fail for me. Building postgres went fine, but the gem wouldn’t. Finally I discovered the trick. The bash environment wasn’t passed through sudo…

So what finally sealed the deal for me was posted on this blogpost:

sudo env ARCHFLAGS='-arch i386' gem install postgres

And presto! Working postgres gem.