エラー
PostgreSQLの Config ファイルがないよっていうエラーの様。
なので、configファイルの場所を指定して上げる方法もある。
$ gem install pg --with-pg-config=/usr/pgsql-9.3/bin/pg_config
でも、そもそもConfigファイルがない場合があるので、その場合の対応が以下になるようです。
対応
CentOS
$ sudo yum -y install postgresql-devel
Ubuntu
$ sudo aptitude install libpq-dev
Mac OSX
$ brew install postgresql
Configファイル
/usr/local/Cellar/postgresql/9.3.2/bin/pg_config あたりにpg_configが生まれる。