Sinatra + Heroku + Datamapper deploy issues with dm-sqlite-adapter

后端 未结 2 1664
悲哀的现实
悲哀的现实 2021-02-10 04:07

For some reason, heroku tries to require dm-sqlite-adapter, even though it should use Postgres here. Note, that this happens when I open any URL - not during the git push itself

2条回答
  •  臣服心动
    2021-02-10 04:35

    Well, too many Rails apps on Heroku, I took the shared db presence for granted. heroku config showed neither DATABASE_URL or SHARED_DATABASE_URL set.

    Issuing heroku addons:add shared-database:5mb solved the problem.

    Strange, that the db wasn't automatically added, despite having 'pg' gem in Gemfile.

    Quote from http://devcenter.heroku.com/articles/cedar:

    A Heroku shared PostgreSQL database (shared-database:5mb) will be automatically added to your app in any of the following cases:

    • The app is a Rails application
    • The pg gem is specified in the Gemfile

提交回复
热议问题