Chronicling my experiences with ruby on rails, web application development/management.

Wednesday, February 18, 2009

PostgreSQL on Mac OS X from source, with gem!

This one was a bitch for me. I started with the one click installer from the postgresql website, not worth the time. maybe it worked, but sure as shit didn't appear to work for me.

Steps i took to get PostgreSQL and postgres gem on my macbook (Intel)

I'll source these links later, but basically I:

  1. downloaded the source code from Postgres's site.

  2. Used the following commands
    ./configure \
    > --with-includes=/usr/local/include \
    > --with-libraries=/usr/local/lib
    sudo make install

  3. put it into my $PATH directory (so annoying when it's not there)
  4. FOR THE RUBY GEM I used the following code because i'm on a fricking intel mac thanks to acts_as_blog
    sudo env ARCHFLAGS='-arch i386' gem install postgres -- \
    --with-pgsql-lib-dir=/Library/PostgreSQL/lib \

Hopefully this saves someone some time and heartache!

There is far too much to detail here...

Acts_as_blog post has everything you need. it should work for you. if it doesn't you need to look at creating your db user through psql.

No comments:

Post a Comment