Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save messutied/4735582 to your computer and use it in GitHub Desktop.
Save messutied/4735582 to your computer and use it in GitHub Desktop.

Fix problems with pg gem on mac os and the postgres App

The problem

I was getting the following error on rails server:

 Library not loaded: /usr/lib/libpq.5.dylib (LoadError)
  Referenced from: /Users/messutiEdd/.rvm/gems/ruby-1.9.3-p362/gems/pg-0.14.1/lib/pg_ext.bundle
  Reason: image not found - /Users/messutiEdd/.rvm/gems/ruby-1.9.3-p362/gems/pg-0.14.1/lib/pg_ext.bundle

The solution

First find pg_config file

find / -name pg_config

Then install the pg gem using that file

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

source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment