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

强颜欢笑 提交于 2019-12-03 08:18:40
LordTwaroog

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

Try doing DataMapper.setup(:default, ENV['DATABASE_URL'] || 'postgres://user:password@hostname/data/mydatabase.db') instead. Heroku is probably looking at the protocol, and therefore requiring SQLite’s dependencies.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!