Recently when updating a Gemfile I came across the following error:
It appears that since I am using Postgres.app 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 Postgres.app the folder structure is a bit off.
I had to modify the commands to the following
1 2 3
After this everything installed correctly and I was able to resume my work.
Hopefully this helps someone out.