site news and other musings.

Install PG Gem With on Mac OSX

| Comments

Recently when updating a Gemfile I came across the following error:

Can't find the 'libpq-fe.h header

It appears that since I am using instead of a more direct installation ( ala brew install pg ) some of the headers are undefined and not accessible by the gem install command.

To get around this problem I came across the following post from Programming Tidbits

Unfortunately did this not work for me as it appears that with the updated version of the folder structure is a bit off.

I had to modify the commands to the following

export CONFIGURE_ARGS="with-pg-include=/Applications/"

gem install pg

After this everything installed correctly and I was able to resume my work.

Hopefully this helps someone out.