【问题标题】:Rails app working locally but not on HerokuRails 应用程序在本地工作,但不在 Heroku 上
【发布时间】:2016-01-12 17:42:02
【问题描述】:

我继承了一个在 heroku 上运行的 rails 应用程序。我需要添加一些我所做的数据库字段并且它在本地工作。我向 heroku 部署了一个新版本,运行了 db:migrate,但由于某种原因它无法正常工作。似乎认为这些字段不存在,但运行 db:migrate:status 我可以看到迁移已经运行:

> heroku run rake db:migrate:status
Running rake db:migrate:status attached to terminal... up, run.6278

database: **censored***

Status   Migration ID    Migration Name
--------------------------------------------------
up     20120107003506  Create conferences
up     20120112003506  Create users
up     20120116200332  Alter conferences country varchar
up     20120116213331  Alter conferences subject varchar
up     20120123215724  Split user name in two
up     20120123224808  Alter conferences add csv generated date
up     20120128211622  Increase conference text field size
up     20120128213531  Add indexes to conferences
up     20120131192147  Add role to user
up     20120131225950  Change subject to subject
up     20120209204719  Add status id to conferences
up     20120625221325  Add index to status
up     20120625225604  Add email sent to conferences
up     20120626231155  Rename email sent column
up     20120706141747  Set organiser emails to lowercase
up     20160112093201  Add conference type to conference
up     20160112142416  New fields

最后两次迁移是我的。 我需要做其他事情吗?

版本: 红宝石 1.9.3 轨道 3.2.3

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-3 heroku


    【解决方案1】:

    您需要重新启动 Dyno 才能使迁移生效。从命令行:

    heroku restart -a your_app_name
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-07-17
      • 2021-03-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-08-19
      • 1970-01-01
      相关资源
      最近更新 更多