Strange WEBrick Error

I was messing around with ruby on my Windows box and for some reason WEBrick kept crashing on me with the following output:

ruby script/server
=> Booting WEBrick…
=> Rails application started on http://0.0.0.0:3000
=> Ctrl-C to shutdown server; call with –help for options
[2007-02-26 03:14:11] INFO WEBrick 1.3.1
[2007-02-26 03:14:11] INFO ruby 1.8.5 (2006-08-25) [i386-mswin32]
[2007-02-26 03:14:11] WARN TCPServer Error: Bad file descriptor – bind(2)
c:/ruby/lib/ruby/1.8/webrick/utils.rb:73:in `initialize’: Bad file descriptor – bind(2) (Errno::EBADF)
from c:/ruby/lib/ruby/1.8/webrick/utils.rb:73:in `new’
from c:/ruby/lib/ruby/1.8/webrick/utils.rb:73:in `create_listeners’
from c:/ruby/lib/ruby/1.8/webrick/utils.rb:70:in `each’
from c:/ruby/lib/ruby/1.8/webrick/utils.rb:70:in `create_listeners’
from c:/ruby/lib/ruby/1.8/webrick/server.rb:75:in `listen’
from c:/ruby/lib/ruby/1.8/webrick/server.rb:63:in `initialize’
from c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:24:in `initialize’
from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/webrick_server.rb:58:in `new’
… 7 levels…
from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/server.rb:39
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
from script/server:3

A quick google indicates that I’m not the only one having this issue but it does seem very rare. Curiously enough the solution turned out to be using a different port for the server. For example I did:

ruby script/server -p8080

That seemed to work just fine. Strange… I’m wondering if this might have something to do with my AV or Firewall blocking connections on port 3000 for some reason…

Update 02/26/2007 12:48:56 PM

It seems that Rich found an explanation for this behavior. The workaround is really simple:

Take that fucking PocketPC out of the fucking cradle and run WEBrick again.

It appears that the wcescomm.exe hugs the port 3000 when Microsoft ActiveSync is running.

[tags]ruby, rails, webrick, ruby on rails, rails issues[/tags]

This entry was posted in programming and tagged . Bookmark the permalink.



One Response to Strange WEBrick Error

  1. Pingback: scott.hodson.blog » WEBrick won’t start on Windows UNITED STATES WordPress

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>