【发布时间】:2020-01-06 23:41:18
【问题描述】:
我真的被这个难住了。我已经尝试了很多东西。
我不得不从 SQLite3 切换到 PostgreSQL,这样我才能在 Heroku 上进行部署。当我在本地运行它时一切正常。在我 git push heroku master 之后发生了一个错误。它开始部署,我得到了这个:
Rails couldn't infer whether you are using multiple databases from your database.yml and can't generate the tasks for the non-primary databases. If you'd like to use this feature, please simplify your ERB.
当我运行 heroku rake 时也会发生这种情况,只是后面跟着这个:
rake aborted! Psych::BadAlias: Cannot load database configuration: Unknown alias: default
随后是堆栈跟踪。
我想我一路上搞砸了。我只是不知道它在期待什么,或者我应该在哪里寻找。我的 database.yml 看起来像这样:
production: adapter: postgresql encoding: utf8 pool: 15 <<: *default url: *db url from heroku* timeout: 5000
非常感谢任何帮助。我对这一切都很陌生。我试过删除和重置数据库。我能提供的最后一点证据是 Heroku 的日志:
heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=ohmydog.herokuapp.com request_id=6217a180-f9ef-43da-8bb0-fc5d064e11fb fwd="185.232.22.206" dyno= connect= service= status=503 bytes= protocol=https
【问题讨论】:
-
嗨,Brian,您能发布完整的 database.yml 文件吗?这个想法是查看“默认”条目。
-
谢谢,下面的评论有助于消除该错误,但我看到另一个错误,所以我会在那里发布
标签: ruby-on-rails postgresql heroku heroku-postgres