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

3
  • Is your up-to-date Gemfile & Gemfile.lock committed in source control? Commented Oct 19, 2011 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 Commented Oct 19, 2011 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. Commented Oct 19, 2011 at 22:25

1 Answer 1

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.

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

2 Comments

ohhh.. does this limit is necessary ? nothing changed, same errors :/
I had done all this, except push the files to heroku via git, worked great, and my rake db:migrate works! Thanks.

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.