scott.hodson.blog

November 11, 2007

WEBrick won’t start on Windows

Filed under: Rails, Ruby — scott @ 9:35 pm

If you get a strange error trying to start WEBrick on Windows like this…


[2007-11-11 20:23:42] INFO WEBrick 1.3.1
[2007-11-11 20:23:42] INFO ruby 1.8.6 (2007-03-13) [i386-mswin32]
[2007-11-11 20:23:42] WARN TCPServer Error: Bad file descriptor - bind(2)
c:/bin/ruby/lib/ruby/1.8/webrick/utils.rb:73:in `initialize': Bad file descriptor - bind(2) (Errno::EBADF)
from c:/bin/ruby/lib/ruby/1.8/webrick/utils.rb:73:in `new'
from c:/bin/ruby/lib/ruby/1.8/webrick/utils.rb:73:in `create_listeners'
from c:/bin/ruby/lib/ruby/1.8/webrick/utils.rb:70:in `each'
from c:/bin/ruby/lib/ruby/1.8/webrick/utils.rb:70:in `create_listeners'
from c:/bin/ruby/lib/ruby/1.8/webrick/server.rb:75:in `listen'
from c:/bin/ruby/lib/ruby/1.8/webrick/server.rb:63:in `initialize'
from c:/bin/ruby/lib/ruby/1.8/webrick/httpserver.rb:24:in `initialize'
from c:/bin/ruby/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/webrick_server.rb:58:in `new'
... 7 levels...
from c:/bin/ruby/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/commands/server.rb:39
from c:/bin/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from c:/bin/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from script/server:3

This is most likely caused by some other already listening on the default port 3000. Perhaps you have another WEBrick server instance running. To see if you have another app running on that port you can run

netstat -a -b

To show the list of applications and what ports they are listening on. If you want to release the port just kill the application listening on that port, or you can run WEBrick on another port like 8080 like this:

ruby script/server -p8080

References:

6 Comments »

  1. Hydrocodone guaifenesin syreth….

    Hydrocodone. Watson hydrocodone. Difference between hydrocodone and morphine….

    Trackback by Hydrocodone detection period. — April 13, 2008 @ 12:05 pm

  2. Buy ambiwn online….

    Buy ambiwn online….

    Trackback by Buy ambiwn online. — April 13, 2008 @ 1:16 pm

  3. Expired percocets effects….

    Expired percocets effects. Pictures of watson479 percocets….

    Trackback by Pictures of watson479 percocets. — April 21, 2008 @ 12:36 pm

  4. Reboxetine….

    Vestra reboxetine. Reboxetine edronax. Reboxetine….

    Trackback by Vestra reboxetine. — July 13, 2008 @ 10:14 pm

  5. Vestra reboxetine….

    Vestra reboxetine….

    Trackback by Reboxetine. — July 14, 2008 @ 1:18 pm

  6. Nursing article on ativan….

    Buy ativan online. Ativan side effects. Ativan. What is ativan….

    Trackback by Ativan. — October 12, 2009 @ 5:59 pm

RSS feed for comments on this post. TrackBack URI

Leave a comment

You must be logged in to post a comment.

Powered by WordPress