Last Updated: February 25, 2016
· mcavallo

Installing the pg gem in Mavericks to use with Postgres.app


Go to http://postgresapp.com/, download the latest version and install it. At the time of writing the latest is version 93 and the name of the app is Postgres93.app.

Apple Developer Tools

Make sure you have the Developer Tools installed. If you installed XCode you can skip this step.

xcode-select --install


If you didn't install homebrew before then go for it.

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

Once you are done make sure homebrew is ready to roll.

brew doctor

In my case I had to install the gcc 4.2 compiler but this might not be necessary.

brew install apple-gcc42

PG Gem

And finally install the pg gem specifying the --with-pg-config option:

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

1 Response
Add your response


I've found it may be easier to add the Postgres.app bin/ directory to my PATH variable. That way you don't need to specify the location of a pg_config file but you also automatically fix any potential issues with not being able to use dropdb or createdb (for example).

over 1 year ago ·