Josh Hepworth

Fix Bundle Install with OS X Postgres App

Using only Postgres.app to build the pg gem in bundler, the bundle install will fail because it can't find pg_config. You can specify that bundler use the file provided in the Postgres.app package by running the following in your terminal:

$ bundle config build.pg --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config

UPDATE: Since I published this, I found a better solution. Add the /bin directory that ships with Postgres.app to your PATH (in .profile, .bashrc, .zshrc, or the like to make sure this gets set for every Terminal session):

PATH="/Applications/Postgres.app/Contents/Versions/9.3/bin:$PATH"

Adding this to your path will ensure that bundler can successfully compile native extensions against your Postgres.app installation when it installs the pg gem.