简体   繁体   English

当我尝试在我的sinatra应用程序中添加机架式闪光灯时,它会停止工作

[英]When I try adding rack-flash to my sinatra app it stops working

I've been using Rack::Flash for a while to display flash notices on responses in my Sinatra apps. 我一直在使用Rack::Flash在我的Sinatra应用程序中显示响应的闪光通知。 Since I upgraded to Sinatra 1.3.2, the app crashes, logging the following whenever I make a request to the server: 自从我升级到Sinatra 1.3.2后,应用程序崩溃,每当我向服务器发出请求时都会记录以下内容:

!! Unexpected error while processing request: undefined method `<<' for nil:NilClass

The simplified code looks like this: 简化的代码如下所示:

require 'sinatra'
require 'rack-flash'

enable :sessions
use Rack::Flash

get "/" do
  "Hello World"
end

Any idea why this could be happening? 知道为什么会发生这种情况吗?

rack-flash doesn't work with the latest versions of rack. rack-flash无法与最新版本的机架配合使用。 Try sinatra-flash instead. 请尝试使用sinatra-flash

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

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