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
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