HOWTO: Get up and running with PostgreSQL and Ruby on Rails on Leopard (Mac OSX 10.5)
Oct 01 ’08
I ran into this problem at work today: for once, instead of Oracle, it was time to use a PostgreSQL database. I've never used PostgreSQL before, so this was all new territory to me.
Looking around online, I found several pages that describe how to do this with MacPorts. But I don't have MacPorts, and I don't want it, since PostgreSQL ships binaries with an installer for Mac OSX. I want something simpler, anyway.
It turns out that the solution is fairly easy:
-
Download PostgreSQL (latest version)
Mount the installer disk image, double click the installer, and follow the instructions
Once the installer has completed, in the terminal do this, with the correct version number at the end of the -with-pgsql-dir parameter: sudo env ARCHFLAGS='-arch i386' gem install postgres -- --with-pgsql-dir=/Library/PostgreSQL/8.3
In your database.yml, make sure you specify the adapter as postgresql
Now your app will talk to postgres!
Start the conversation
* indicates a required field








