Question

I am getting this error when running heroku rake db:migrate:

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

I looked online and found to add the 'pg' gem. I added it using gem install pg and also put it in my gem file. I have done a bundle install. When I try and do the command 'sudo gem install activerecord-postgresql-adapter', it tells me the gem can not be found.

Also, I added 'pg' to my gemfile and tried to run my code on my local machine and it would not run because it could not find pg. I somehow got pg to install and my program works again on my local computer but it still gives me the error when performing heroku rake db:migrate

Was it helpful?

Solution

After you've added gem 'pg' to your gemfile, you'll need to also run bundle from the terminal under your application root folder as this will regenerate your 'Gemfile.lock' file.

Then commit your changes, and do a git push heroku that should do the trick.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top