Foliosus Web Design LLC: Your website done right

Blogfolio

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

    New comment

    Will never be disclosed or used inappropriately

    Enter the word how to confirm that you are a human being

    About the author

    Brent Miller is the owner and principal web designer of Foliosus Web Design LLC in Portland, Oregon. He enjoys food, plants, and the color green. If you are interested in hiring him for web work, please contact him.

    Categories

    Plant of the day

    Unknown sp. (Bromeliaceae)

    Unknown sp. (Bromeliaceae)

    Fresh photos