rails/web-console

Issue with web-console (4.0.3), rack (2.2.3) and webrick

codingiam opened this issue · 3 comments

I have a project with:

  • ruby (2.6.5)
  • rails (6.0.3.2)
  • web-console (4.0.3)
  • rack (2.2.3)

I start my application with WEBrick:
bundle exec rails server -u webrick

Whenever an exception occurs instead of getting the web-console UI I get the following error:

ERROR NoMethodError: undefined method `split' for 196974:Integer
	vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/handler/webrick.rb:108:in `block in service'
	vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/utils.rb:446:in `block in each'
	vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/utils.rb:445:in `each'
	vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/utils.rb:445:in `each'
	vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/handler/webrick.rb:99:in `service'
	~/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/webrick/httpserver.rb:140:in `service'
	~/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/webrick/httpserver.rb:96:in `run'
	~/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/webrick/server.rb:307:in `block in start_thread'

I was not getting this exception with web-console (4.0.2).

This started appearing with web-console (4.0.3) and it seems related to this change #290.

It looks like following that change "Content-Length" header value is an integer and Rack expects a string.

Thanks for the report. Looks like webrick expects the value as a string, yeah. Will test it locally and release 4.0.4 with a fix.

Should be fixed in 4.0.4 by fb48374. Please, feel free to reopen the issue if the problem still persists.

It works with 4.0.4. Thank you!