1

I have trouble deploying my app on heroku. I have added 'pg' gem to Gemfile, and even try to include something like gem 'therubyracer-heroku'. during

heroku rake db:migrate

I get something like this:

>heroku rake db:migrate
 --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
Please install the postgresql adapter: `gem install activerecord-postgresql-adap
ter` (pg is not part of the bundle. Add it to Gemfile.)
/app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/connectio
n_adapters/abstract/connection_specification.rb:71:in `rescue in establish_conne
ction'

Another interesting part is that while pushing to heroku pg is not mentioned during bundle install operation like if it was ignored. I also watched the Gemfile.lock and pg is mentioned there to:

pg (0.11.0-x86-mingw32)

I wonder if it is a Windows gem issue that cause heroku to ignore the pg gem or something ?

Can anyone help or had similar problem ?

//EDIT

Seems related: enter link description here

And looks unsolveable

Community
  • 1
  • 1
avallach
  • 63
  • 5
  • Is your up-to-date Gemfile & Gemfile.lock committed in source control? – Neil Middleton Oct 19 '11 at 14:48
  • Yes I do sth like this change gemfile run local bundle, then commit both and after that push gives me error `You have modified your Gemfile in development` so I change sth in .lock file like remove PLATFORMS section to be able to push – avallach Oct 19 '11 at 17:15
  • OK - That message is normally issued by Heroku when your Gemfile.lock is not up to date with what is in your Gemfile. I would clone your repo to a new location and see what comes out just to check it's in git properly. Failing that, contact Heroku support. – Neil Middleton Oct 19 '11 at 22:25

1 Answers1

2

In your Gemfile limit postgres to your production group;

group :production do
  gem "pg"
end

rebundle

bundle --without production

and commit to git (Gemfile and Gemfile.lock) and push to Heroku. That should solve your problem.

John Beynon
  • 37,398
  • 8
  • 88
  • 97
  • 1
    ohhh.. does this limit is necessary ? nothing changed, same errors :/ – avallach Oct 19 '11 at 17:11
  • I had done all this, except push the files to heroku via git, worked great, and my rake db:migrate works! Thanks. – Ryan Jan 22 '12 at 06:11