Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

ruby

sinatra

rack

I've been using Rack::Flash for a while to display flash notices on responses in my Sinatra apps. Since I upgraded to Sinatra 1.3.2, the app crashes, logging the following whenever I make a request to the server:

!! 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?

like image 565
cesarsalazar Avatar asked Feb 21 '23 13:02

cesarsalazar


1 Answers

rack-flash doesn't work with the latest versions of rack. Try sinatra-flash instead.

like image 180
mipadi Avatar answered Apr 27 '23 19:04

mipadi