Last Updated: February 25, 2016
·
626
· artchang

Install pg gem with Postgress.app

When doing a simple gem install pg with the Heroku created Postgress.app, the gem installation fails with the error:

checking for pg_config... no No pg_config... trying anyway. If building fails, please try again with --with-pg-config=/path/to/pg_config

The reason is, the pg_config can't be found. What you'll need to do is, install the pg gem with the path that Postgres.app created. The paths can be found on their site: http://postgresapp.com/documentation/

So simply do this:

gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/MacOS/bin/pg_config

That should be the path where the pg_config is located.