当前位置 : 主页 > 编程语言 > ruby >

ruby-on-rails – 如何暂时使我的staging rails服务器显示错误?

来源:互联网 收集:自由互联 发布时间:2021-06-23
在我的开发框中,当我收到后端错误时,它会给出错误消息和堆栈跟踪.然而,在临时服务器上它只是说 "We're sorry, but something went wrong. If you are the application owner check the logs for more information.
在我的开发框中,当我收到后端错误时,它会给出错误消息和堆栈跟踪.然而,在临时服务器上它只是说

"We're sorry, but something went wrong. If you are the application owner check the logs for more information."

所以是的,我知道我可以检查日志.但是,如果我想在浏览器中看到堆栈跟踪怎么办?我可以暂时启用它吗?这适用于Rails 4.04和Ruby 2.1

是的,您可以通过设置启用在暂存环境中显示堆栈跟踪

config.consider_all_requests_local = true

在您的Rails应用程序的confing / environments / staging.rb文件中.

网友评论