1
votes

I'm trying to do a heroku db:migrate with my mySQL database and I'm getting the error/suggestion:

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

I try to put the "gem install activerecord-postgresql-adapter" in my gem-file, but when I run bundle install, I get:

charlotte-dator:showwwdown holgersindbaek$ bundle install /Users/holgersindbaek/Projekter/Showwwdown/showwwdown/Gemfile:34:in evaluate': undefined local variable or methodactiverecord' for # (NameError) from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/definition.rb:17:in build' from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler.rb:138:indefinition' from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/cli.rb:219:in install' from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/vendor/thor/task.rb:22:insend' from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/vendor/thor/task.rb:22:in run' from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/vendor/thor/invocation.rb:118:ininvoke_task' from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/vendor/thor.rb:263:in dispatch' from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/vendor/thor/base.rb:386:instart' from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/bin/bundle:13 from /usr/bin/bundle:19:in `load' from /usr/bin/bundle:19

Hope you can help. Thanks!

2
Thank you. There seemed to be some help there. After I added gem 'pg' to my gemfile and ran bundle install, I forgot to commit and push to herokuHolger Sindbaek

2 Answers

1
votes

Add the following line to your gemfile (instead):

gem 'pg'

If you don't use Postgres in development, you can do this:

gem 'pg', :group => :production
1
votes

Make sure the branch you are pushing to heroku is master branch.

In my case i had tried all above & it was not working. I had done another mistake when i pushed my git repository i didn't push master branch but instead another 'named' branch. So my changes were not getting reflected even after updating gem file etc .