Coding Tidbits

Cube Root is an exclusive Ruby on Rails Consultancy. Find our programming ramblings here.

Install pg gem on Mac OSX Mavericks with Postgres.app

When I was trying to install pg gem on OSX Mavericks it failed with following error

gem install pg
.
.
.
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header

I am using Postgres.app on my mac. Turns out the installer cannot locate the include headers, and it's a easy fix.

export CONFIGURE_ARGS="with-pg-include=/Applications/Postgres.app/Contents/MacOS/include"
gem install pg

The gem installs successfully. Hope this helps someone.