在rails app中显示错误.关于heroku应用程序的第500页

rat*_*tan 1 ruby-on-rails heroku

我正在Heroku上部署一个应用程序.虽然部署的经验很好,但我很难修复.

首先autoincrement,在heroku数据库和我的数据库之间,ID都被搞砸了.因此,在部署之前,我必须从本地应用程序中删除所有数据,然后将我的数据库推送到heroku.如果我不这样做,那么在尝试在heroku应用程序上添加记录时,我会遇到重复的键错误.有没有办法控制轨道中的自动增量id?

第二件事,当heroku app上有错误时.我看到自定义500错误页面.We're sorry, but something went wrong(500).有没有办法显示某种错误信息呢?或者我必须依赖于heroku日志?这只是为了开发,所以如果发生一些错误,我只想在页面上看到它.至少有一部分......

我是Heroku和Rails的新手

den*_*min 6

自动增量问题:

也许使用种子数据是一个更好的解决方案,你可以看到http://railscasts.com/episodes/179-seed-data

错误问题:

在config/environments/production.rb中

尝试更换

config.action_controller.consider_all_requests_local = false
config.action_controller.perform_caching             = true
config.action_view.cache_template_loading            = true
Run Code Online (Sandbox Code Playgroud)

通过

config.action_controller.consider_all_requests_local = true
config.action_view.debug_rjs                         = true
config.action_controller.perform_caching             = false
Run Code Online (Sandbox Code Playgroud)

干杯