rack-flash icon indicating copy to clipboard operation
rack-flash copied to clipboard

undefined method '<<' for nil:NilClass

Open ghost opened this issue 12 years ago • 28 comments

It does not seem to be working with Sinatra 1.3.2

When just requiring rack-flash it throws this error:

ERROR NoMethodError: undefined method `<<' for nil:NilClass
    /Users/david/.rvm/gems/ruby-1.9.3-p0/gems/rack-flash-0.1.2/lib/rack/flash.rb:11:in `use'
    /Users/david/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:1339:in `setup_default_middleware'
    /Users/david/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:1327:in `build'
    /Users/david/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:1321:in `new'
    /Users/david/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:1311:in `prototype'
    /Users/david/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:1334:in `block in call'
    /Users/david/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:1416:in `synchronize'
    /Users/david/.rvm/gems/ruby-1.9.3-p0/gems/sinatra-1.3.2/lib/sinatra/base.rb:1334:in `call'
    /Users/david/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.0/lib/rack/handler/webrick.rb:59:in `service'
    /Users/david/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
    /Users/david/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
    /Users/david/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'

ghost avatar Jan 08 '12 18:01 ghost

Also happening to me.

carsonbaker avatar Jan 09 '12 06:01 carsonbaker

I'm getting this too

daz4126 avatar Jan 09 '12 22:01 daz4126

It works with Sinatra 1.3.2, but you must downgrade Rack to v1.3.6.

tonkla avatar Jan 11 '12 02:01 tonkla

throwing a "me too" on this, the workaround @tonkla posted works for me, rack was on 1.4.0, went down to 1.3.6 and the error goes away.

ptinsley avatar Jan 14 '12 04:01 ptinsley

So, is this a Rack-flash issue, or a Rack issue?

ghost avatar Jan 14 '12 10:01 ghost

Rack 1.4.0 was changed the infrastructure, so Rack-flash will follow that steps.

tonkla avatar Jan 14 '12 10:01 tonkla

Also confirmed here

julik avatar Jan 17 '12 14:01 julik

Confirmed this as an issue on my end as well. This is occurring on Heroku with the bamboo-mri-1.9.2 stack. Text of error:

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

thekeith avatar Jan 20 '12 01:01 thekeith

Confirmed with these: Using bundler (1.0.21) Using rack (1.3.5) Using rack-flash (0.1.2) Using sinatra (1.3.1) ruby 1.9.3p0

CloudMarc avatar Jan 20 '12 20:01 CloudMarc

Pretty funny, I just ran into this yesterday :)

Aleks

On Fri, Jan 20, 2012 at 12:23 PM, Marc Byrd [email protected] wrote:

Confirmed with these:  Using bundler (1.0.21)  Using rack (1.3.5)  Using rack-flash (0.1.2)  Using sinatra (1.3.1)  ruby 1.9.3p0


Reply to this email directly or view it on GitHub: https://github.com/nakajima/rack-flash/issues/8#issuecomment-3589900

atotic avatar Jan 20 '12 22:01 atotic

Same here, any workaround in the meantime?

ghost avatar Jan 31 '12 13:01 ghost

I've the same problem, downgrading rack to 1.3.6 in the meantime, Gemfile: gem "rack", "<= 1.3.6"

Using rack (1.3.6) 
Using rack-flash (0.1.2) 
Using sinatra (1.3.2) 

4poc avatar Feb 03 '12 08:02 4poc

alternative: sinatra-flash

jessor avatar Feb 03 '12 10:02 jessor

Yeah, that's what I've moved to at this point.

codykrieger avatar Feb 03 '12 10:02 codykrieger

I've had a look and it seems to be caused by some dead code. Removing it seemed to fix it for me, and I'm not sure what it was ever supposed to do because it was monkey patching Rack::Builder!!

https://github.com/ChrisCauser/rack-flash

The tests don't run because it requires Sinatra < 1.0 (again, !!!!) Once I've had a look at the tests I'll put in a pull request, but in the meantime folks, take a look at the fork linked above.

chy-causer avatar Feb 14 '12 16:02 chy-causer

Can someone pull Chris Causer's fix?

seydar avatar Mar 09 '12 17:03 seydar

Hey guys, decided to go ahead and push a new gem that includes @ChrisCauser 's fixes, you can use it with:

gem 'rack-flash3'

Project: https://github.com/treeder/rack-flash

treeder avatar Mar 19 '12 18:03 treeder

@treeder, does it really need to require Ruby 1.9?

viking avatar Mar 27 '12 16:03 viking

@viking probably not, copied that rakefile from another gem. Removed and pushed new version just now.

treeder avatar Mar 27 '12 16:03 treeder

Awesome, thanks

viking avatar Mar 27 '12 18:03 viking

+1, same error here. Thanks to @treeder for rack-flash3, I'm using that now instead.

wapcaplet avatar Apr 26 '12 16:04 wapcaplet

+1, Thanks @treeder , rack-flash3 works!

learning avatar Apr 28 '12 08:04 learning

np. ;)

treeder avatar Apr 28 '12 21:04 treeder

rack-flash3 works great! thanks! @nakajima should merge in the fix!

mmmurf avatar May 15 '12 05:05 mmmurf

rack-flash3 is the great fix (had to gem uninstall rack-flash to make her work) Thank! Merge it!

malachaifrazier avatar Jun 26 '12 02:06 malachaifrazier

Thanks @malachaifrazier. That fix may have been obvious to some but it saved me a brief headache at the very least.

bradley avatar Sep 26 '12 04:09 bradley

This projects seems dead, not able to merge pull request for 8 months.

rubycut avatar Sep 28 '12 09:09 rubycut

I'm trying to use rack-flash3 with sinatra-authentication, unfortunately I cannot get the latter gem to recognize it. The only way I can get the sinatra-authentication gem to work is by using the Rack 1.3.6 gem, 1.4.1 does not fix the issue.

rupe avatar Nov 03 '12 22:11 rupe