こんな具合に gem install pg できなかった。

checking for pg_config… no No pg_config… trying anyway. If building fails, please try again with –with-pg-config=/path/to/pg_config checking for libpq-fe.h… no Can't find the 'libpq-fe.h header ** extconf.rb failed ** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

対処法

pg_config のパスの指定をしたい場合

gem install pg --with-pg-config=/usr/local/bin/pg_config