简体   繁体   English

Rails + Heroku:应用程序在Heroku上崩溃但在本地服务器上运行

[英]Rails + Heroku: App crashing on Heroku but working on local server

I've just changed one of my models to support an enum (available since rails 4.1 I think). 我刚刚更改了一个模型来支持枚举 (我认为从Rails 4.1开始可用)。 My app continues to run on my local server but when I deploy to Heroku I get an App Crashed error in the logs and an Application Error when I visit the site. 我的应用程序继续在本地服务器上运行,但是当我部署到Heroku时,在日志中出现“ Application Error App Crashed错误,而在访问该站点时出现“ Application Error ”。 If I remove the enum declaration line from my model it works again. 如果我从模型中删除枚举声明行,它将再次起作用。 Any ideas why this is happening? 任何想法为什么会这样?

class ModelName < ActiveRecord::Base
  enum status: [ :new ,:old, :both ]
end

Heroku logs: Heroku日志:

at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=app.herokuapp.com request_id=005c1584-7217-4685-b41e-a5657122d9e2 fwd="89.242.203.122" dyno= connect= service= status=503 bytes=

It's a very vague question, to be honest. 老实说,这是一个非常模糊的问题。 Here's my precursory answer though. 这是我的先验答案。 Check if you're precompiling your assets in your app. 检查您是否在应用程序中预编译资产。 If that doesn't work, see if you're using Postgres as your production databse adapter in your gemfile. 如果这不起作用,请查看您是否在宝石文件中使用Postgres作为生产数据库适配器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM