Heroku with rails 5 error Gem::LoadError: Specified 'postgresql' for database adapter

前端 未结 1 1179
梦毁少年i
梦毁少年i 2020-12-07 04:16

I am a Rails beginner and i see some issue while deploying to Heroku.

Earlier i used SQLite3, later when i understood that i needed postgresql i installed the same a

相关标签:
1条回答
  • 2020-12-07 04:34

    If you have recently deployed your app to Heroku and in your attempt have been getting the "App crashed" error when you go to the Heroku app link, but everything else seems to be in order, it's most likely due to a new release of the 'pg' gem. Postgres has released a new version of its gem which seems not fully compatible yet, so in your Gemfile under group production change the line:

    gem 'pg'
    OR
    gem 'pg', '~> 1.0.0'
    

    to

    gem 'pg', '~> 0.11'
    OR
    gem 'pg', '~> 0.20.0'
    

    Note: the tilde sign before the >, that's not a dash

    Once you make this update in your group production of your Gemfile, ensure you run bundle install --without production (to update Gemfile.lock file), do a git add/commit cycle, then re-deploy to Heroku.

    For Good Practice

    Use pg gem one time without :group because your database is same for both development & production!

    0 讨论(0)
提交回复
热议问题