How can we restart WEBrick in ruby 2.2?

Hello,

I have a problem with ruby 2.2 + Middleman which calls WEBrick::HTTPServer#start after WEBrick::HTTPServer#stop.

1. Type "middleman server" in shell
2. Modify config.rb
3. Then Middleman tries to restart WEBrick automatically but fails and keep showing the same exception below:

        ERROR NoMethodError: undefined method `' for nil:NilClass
        /Users/koji/.rbenv/versions/2.2.1/lib/ruby/2.2.0/webrick/server.rb:174:in `block in start'

Meanwhile, it works in ruby 2.1.5.
(Here is a simple code to reproduce: Fix #1430 by recreating WEBrick server instead of reusing by codeout · Pull Request #1475 · middleman/middleman · GitHub)

Doesn't WEBrick support restarting (#start after #stop) any more?

Seems like the API was changed by this commit:
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?revision=48353&view=revision

Author: akr
Date: Sun Nov 9 23:03:40 2014 UTC (3 months, 3 weeks ago)
Changed paths: 3
Log Message:
* lib/webrick/server.rb (initialize): Initialize shutdown pipe here
to avoid race condition.
(cleanup_shutdown_pipe): New private method.
(cleanup_listener): Extracted from shutdown method.
Call this method from start method to avoid race condition.

Thanks

Shintaro Kojima

This seems like a legit regression. Can you file a bug on bugs.ruby-lang.org?

···

On Mar 7, 2015, at 07:29, Shintaro Kojima <goodies@codeout.net> wrote:

       ERROR NoMethodError: undefined method `' for nil:NilClass
       /Users/koji/.rbenv/versions/2.2.1/lib/ruby/2.2.0/webrick/server.rb:174:in `block in start'

Meanwhile, it works in ruby 2.1.5.
(Here is a simple code to reproduce: Fix #1430 by recreating WEBrick server instead of reusing by codeout · Pull Request #1475 · middleman/middleman · GitHub)

This seems like a legit regression. Can you file a bug on bugs.ruby-lang.org?

OK, I will. Thanks.

Shintaro Kojima

···

2015/03/08 14:28、Ryan Davis <ryand-ruby@zenspider.com> のメール:

On Mar 7, 2015, at 07:29, Shintaro Kojima <goodies@codeout.net> wrote:

      ERROR NoMethodError: undefined method `' for nil:NilClass
      /Users/koji/.rbenv/versions/2.2.1/lib/ruby/2.2.0/webrick/server.rb:174:in `block in start'

Meanwhile, it works in ruby 2.1.5.
(Here is a simple code to reproduce: Fix #1430 by recreating WEBrick server instead of reusing by codeout · Pull Request #1475 · middleman/middleman · GitHub)

This seems like a legit regression. Can you file a bug on bugs.ruby-lang.org?