Se você não tiver o postgres instalado , você pode querer ir com:
sudo apt-get install postgresql
sudo apt-get install libpq-dev
seguindo por
gem install pg e bundle . Se você tiver o postgres instalado e executando
gem install pg não funciona, você tem que executar which pg_config para obter o caminho para o seu pg_config , e execute gem install pg -- --with-pg-config= output_from_previous_command .