· November 2013 ·

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
Sign in or sign up to add your response.

1 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 ·
Featured Programming Job

Web Designer
Cambridge, MA
Full Time
Search all programming jobs