2

When I try to run

heroku rake db:migrate

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)

Here's what my Gemfile looks like:

group :production do
  gem 'pg'
end

group :development, :test do
  gem 'turn', '0.8.2', :require => false
  gem 'sqlite3', '1.3.5'
end

So I added the 'pg' to the Gemfile but it still complains. I'm a bit in dispair because I don't know what to do next..?

UPDATE The command heroku run rake db:migrate leads to the same error.

Here's my Gemfile:

source 'http://rubygems.org'

gem 'rails', '3.1.3'

group :production do gem 'pg', '0.12.0' end

group :development, :test do # Pretty printed test output gem 'turn', '0.8.2', :require => false gem 'sqlite3', '1.3.5' end

# Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git'

# Gems used only for assets and not required # in production environments by default. group :assets do gem 'sass-rails', '~> 3.1.5' gem 'coffee-rails', '~> 3.1.1' gem 'uglifier', '>= 1.0.3' end

gem 'jquery-rails'

# To use ActiveModel has_secure_password # gem 'bcrypt-ruby', '~> 3.0.0'

# Use unicorn as the web server # gem 'unicorn'

# Deploy with Capistrano # gem 'capistrano'

# To use debugger # gem 'ruby-debug19', :require => 'ruby-debug'

Thank you so much for your help!

UPDATE 2

Here's my Gemfile.lock:

GEM
  remote: http://rubygems.org/
  specs:
    actionmailer (3.1.3)
      actionpack (= 3.1.3)
      mail (~> 2.3.0)
    actionpack (3.1.3)
      activemodel (= 3.1.3)
      activesupport (= 3.1.3)
      builder (~> 3.0.0)
      erubis (~> 2.7.0)
      i18n (~> 0.6)
      rack (~> 1.3.5)
      rack-cache (~> 1.1)
      rack-mount (~> 0.8.2)
      rack-test (~> 0.6.1)
      sprockets (~> 2.0.3)
    activemodel (3.1.3)
      activesupport (= 3.1.3)
      builder (~> 3.0.0)
      i18n (~> 0.6)
    activerecord (3.1.3)
      activemodel (= 3.1.3)
      activesupport (= 3.1.3)
      arel (~> 2.2.1)
      tzinfo (~> 0.3.29)
    activeresource (3.1.3)
      activemodel (= 3.1.3)
      activesupport (= 3.1.3)
    activesupport (3.1.3)
      multi_json (~> 1.0)
    ansi (1.4.1)
    arel (2.2.1)
    builder (3.0.0)
    coffee-rails (3.1.1)
      coffee-script (>= 2.2.0)
      railties (~> 3.1.0)
    coffee-script (2.2.0)
      coffee-script-source
      execjs
    coffee-script-source (1.1.3)
    erubis (2.7.0)
    execjs (1.2.12)
      multi_json (~> 1.0)
    hike (1.2.1)
    i18n (0.6.0)
    jquery-rails (1.0.19)
      railties (~> 3.0)
      thor (~> 0.14)
    json (1.6.3)
    mail (2.3.0)
      i18n (>= 0.4.0)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    mime-types (1.17.2)
    multi_json (1.0.4)
    pg (0.12.0)
      rake-compiler (~> 0.7)
    polyglot (0.3.3)
    rack (1.3.5)
    rack-cache (1.1)
      rack (>= 0.4)
    rack-mount (0.8.3)
      rack (>= 1.0.0)
    rack-ssl (1.3.2)
      rack
    rack-test (0.6.1)
      rack (>= 1.0)
    rails (3.1.3)
      actionmailer (= 3.1.3)
      actionpack (= 3.1.3)
      activerecord (= 3.1.3)
      activeresource (= 3.1.3)
      activesupport (= 3.1.3)
      bundler (~> 1.0)
      railties (= 3.1.3)
    railties (3.1.3)
      actionpack (= 3.1.3)
      activesupport (= 3.1.3)
      rack-ssl (~> 1.3.2)
      rake (>= 0.8.7)
      rdoc (~> 3.4)
      thor (~> 0.14.6)
    rake (0.9.2.2)
    rake-compiler (0.7.9)
      rake
    rdoc (3.12)
      json (~> 1.4)
    sass (3.1.12)
    sass-rails (3.1.5)
      actionpack (~> 3.1.0)
      railties (~> 3.1.0)
      sass (~> 3.1.10)
      tilt (~> 1.3.2)
    sprockets (2.0.3)
      hike (~> 1.2)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    sqlite3 (1.3.5)
    thor (0.14.6)
    tilt (1.3.3)
    treetop (1.4.10)
      polyglot
      polyglot (>= 0.3.1)
    turn (0.8.2)
      ansi (>= 1.2.2)
    tzinfo (0.3.31)
    uglifier (1.2.0)
      execjs (>= 0.3.0)
      multi_json (>= 1.0.2)

PLATFORMS
  ruby

DEPENDENCIES
  coffee-rails (~> 3.1.1)
  jquery-rails
  pg (= 0.12.0)
  rails (= 3.1.3)
  sass-rails (~> 3.1.5)
  sqlite3 (= 1.3.5)
  turn (= 0.8.2)
  uglifier (>= 1.0.3)
5
  • Did you run bundle install --without production and check in the resulting Gemfile.lock before pushing up again? Commented Dec 20, 2011 at 13:06
  • did you check in your gemfile.lock? I bet that was the issue previously. Now you probably need to run "bundle install" because for some reason your gemfile.lock is not matching what heroku thinks it should have. Commented Dec 20, 2011 at 14:31
  • yeah, I ran that command. But as I am quite new to RoR I am not sure what to watch out for. I have pg listed under specs and listet under DEPENDENCIES as well. How can I check the Gemfile.lock for errors? When I type bundle install I dont see the line Using pg (0.12.0) - this is kind of strange isn't it? Commented Dec 20, 2011 at 15:20
  • 1
    Looks the same as this one except that you're not doing heroku create --stack cedar: stackoverflow.com/questions/7492636/… Commented Dec 20, 2011 at 22:55
  • I ran that command but to no avail. I don't know what else to do... Commented Dec 20, 2011 at 23:15

2 Answers 2

1

If you are on Cedar you need to run heroku run rake db:migrate although that does not sound like the case. If you are running rails 3 or > you should be using the cedar stack though.

You could also try adding gem 'pg', " ~> 0.12.0" to your gem file and run bundler again (bundle install) that should get pg to your Gemfile.lock (look for something like:pg (0.12.0))

If that does not work can tell us your environment and maybe paste the heroku --trace log?

Sign up to request clarification or add additional context in comments.

7 Comments

Thank you. I will try that as soon as I am home. Just one question: What excactly is Cedar?
I posted my Gemfile to the original post. The command heroku run rake db:migrate unfortunately leads to the same error.
No Problem. Hopefully that will work. Cedar Stack is the heroku Stack that is properly configured for rails 3 or greater. You can read more about it here.
Do you see pg (0.12.0) inside gemfile.lock?
I posted my Gemfile.lock in the original post. By the way I am running on Ubuntu 10.04
|
0

try adding this to your gemfile

gem 'therubyracer'

bundle it, and then run all necessary commands.

1 Comment

No sorry that didn't help I added the line in the gemfile, bundled it and ran again heroku rake db:migrate - same error as before. I am running on Ubuntu 10.04 fyi.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.