I got the same error on Centos. By googling I found two commands to use:
yum install postgresql-libs— It gave me message saying, its already installed.yum install postgresql-devel— It solved my error related topg_configfor installing the ‘pg’ .gem.
Hope it helps 🙂
apos wrote: on Ubuntu 14.04 install:
apt-get install postgresql-server-dev-9.3 libpq-dev