Today I encountered an interesting problem and one that was a first for me. I was testing my Rails app and started the WEBrick server. I then received the following error message:
[2006-04-12 23:01:13] INFO WEBrick 1.3.1
[2006-04-12 23:01:13] INFO ruby 1.8.2 (2004-12-25) [i386-mswin32]
[2006-04-12 23:01:13] WARN TCPServer Error: Only one usage of each socket address (protocol/network address/port) is normally permitted. - bind(2) c:/program files/ruby/lib/ruby/1.8/webrick/utils.rb:62:in `initialize’: Only one usage of each socket address (protocol/network address/port) is normally permitted. - bind(2) (Errno::EADDRINUSE)
It turns out that an existing process had a hold of port 3000. While I had no clue what could possibly be using this port I started looking through my processes one-by-one. I finally realized the only difference in my environment today was that I was on my PC and ActiveSync was currently running. This was the first time I ever tried starting WEBrick with my phone docked. It sounds completely unrelated, but it turns out that ActiveSync had a lock on port 3000 and disconnecting my device solved the problem. I’m certain there’s a way to start WEBrick on another port, but I have a workaround for now. I wanted to post this to prevent anyone else from wasting an hour trying to figure out what’s going on.
ActiveSync was indeed my problem - as soon as I removed my iPaq from its cradle it worked.
Many thanks.