In order for heroku to install the database to production successfully you have to modify the Gemfile to only install the gem "pg" in production environment only.
Example Gemfile config
group :production do gem "pg" end
bundle install --without production
git push heroku master
heroku run rake db:migrate
This is a test of Rails 3.1 deployment to
Hopefully it works.