1

I'm trying to run heroku rake db:migrate, and I get the following error:

rake aborted!
Please install the postgresql adapter: `gem install activerecord-postgresql-adapter` (pg is   not part of the bundle. Add it to Gemfile.)

Tasks: TOP => db:migrate => db:load_config
(See full trace by running task with --trace)

I've followed the instructions in this post, namely to:

  1. add 'pg' to Gemfile, under :production
  2. run bundle install --without production

But I still get the error.

Here's my Gemfile:

source 'http://rubygems.org'

  gem "rails", "~> 3.1.0"
  gem 'gravatar_image_tag', '1.0.0.pre2'
  gem 'will_paginate', '~> 3.0.2'
  gem 'jquery-rails', '>= 1.0.12'

group :assets do
  gem 'sass-rails', "~> 3.1.0"
end

group :development do
  gem 'rspec-rails', '2.6.1'
  gem 'faker', '0.3.1'
  gem 'sqlite3', '~> 1.3.4'
end

group :test do
  gem 'rspec-rails', '2.6.1'
  gem 'webrat', '0.7.1'
  gem 'guard-rspec'
  gem 'growl_notify'
  gem 'factory_girl_rails', '1.0'
  gem 'sqlite3', '~> 1.3.4'
end

group :production do
  gem 'pg'
end

Someone on #RubyOnRails suggested it was an incorrectly configured database.yml for production, but to quote the Heroku site itself, "To ease deployment of typical Rails applications, Heroku automatically generates a new database.yml file on deployment."

I'm stumped. Any ideas?

Community
  • 1
  • 1
andrewhl
  • 992
  • 1
  • 11
  • 31
  • few questions. After bundling `without --production` did you commit and push both Gemfile and Gemfile.lock to Heroku? Also, what OS are you running on locally? – John Beynon Nov 06 '11 at 16:10
  • Thanks, John. I'm a bit red-faced to admit that the answer was simply to commit and push to heroku again. Oy. – andrewhl Nov 06 '11 at 18:42
  • easily done. We've all done it :) Given it as an answer so you can mark it accepted. – John Beynon Nov 06 '11 at 19:15

1 Answers1

2

Double check you've commit and pushed both the Gemfile and Gemfile.lock to Heroku.

John Beynon
  • 37,398
  • 8
  • 88
  • 97