Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/delphi/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Error handling ubuntu生产中的Sinatra和自定义漂亮错误_Error Handling_Sinatra_Rack_Production Environment - Fatal编程技术网

Error handling ubuntu生产中的Sinatra和自定义漂亮错误

Error handling ubuntu生产中的Sinatra和自定义漂亮错误,error-handling,sinatra,rack,production-environment,Error Handling,Sinatra,Rack,Production Environment,我要把头发扯下来。在我的mac电脑上,会显示我想向用户显示的自定义漂亮错误。当我部署到我的ubuntu盒时,我会收到一条最小的黑白错误消息 我有sinatra的错误处理,就像这样 set :raise_errors, false set :show_exceptions, false not_found do erb :'errors/not_found' end 我认为这是因为我在运行nginx和thin(在ubuntu上),但是如果我绕过这个堆栈直接运行,我在ubuntu上仍然有

我要把头发扯下来。在我的mac电脑上,会显示我想向用户显示的自定义漂亮错误。当我部署到我的ubuntu盒时,我会收到一条最小的黑白错误消息

我有sinatra的错误处理,就像这样

set :raise_errors, false
set :show_exceptions, false

not_found do
    erb :'errors/not_found'
end
我认为这是因为我在运行nginx和thin(在ubuntu上),但是如果我绕过这个堆栈直接运行,我在ubuntu上仍然有问题

ruby start.rb #I get a minimal black and white error

无论我如何启动,甚至使用Rack::ShowExceptions,我在mac上都会遇到相当大的错误。我正在运行ruby 1.9.2和sinatra 1.3.2


有什么线索可以告诉我如何在生产过程中给用户带来相当大的错误吗?

好吧,在几周内尝试修复失败后,我意识到我在做一些愚蠢的事情。我的production config.yaml中缺少[email_errors][to]。这破坏了我的错误处理程序。如果我在config.ru中添加“use rack::ShowExceptions”时读取了机架堆栈跟踪,我就会看到问题,除非我没有读取它,因为错误处理程序抛出的错误与我在测试错误中预期的错误相同。愚蠢的疏忽

rackup -E production config.ru  #I get a minimal black and white error
rackup -E development config.ru  #I get rack stack trace