I’ve been dealing with this insanely frustrating problem for a few weeks now. I do most of my Rails development on my Mac, but run instances on both Linux and Windows XP. XP has burned me until I won the battle this evening. I was able to install Rails through a manual process a while back. After getting Rails running on XP I struggled with the WEBrick server. The server would start and listen on port 3000, but when I made any request the browser would hang and so would the Ruby process.
After digging around this evening I stumbled across a link that talks about Winsock getting corrupted every now and then. While it doesn’t mention Ruby specifically I was desperate and decided to give it a try. I ran the following from my XP command prompt:
netsh winsock reset
and waited for a minute. It appeared that everything was reset so I started WEBrick back up and low and behold….it worked! I rebooted a couple of times just to verify that the fix was going to hang around and it sure did.
I found http://instantrails.rubyforge.org/ is an acceptible sollution for running a test ruby on rails environment on Windows XP.
Thanks for the link Paul. I’m familiar with Instant Rails, but have never used it. The interesting point about my XP woes is that I’ve previously had no problems at all. I’ll still look into giving Instant Rails a go.
this saved my bacon - every time i would fire up webrick, and made a request (either the hello world app newbie project, or the rdoc server), it would hang. instant rails, plain rails, installing ruby singly and bootstrapping gems and rails, etc etc. all failed
that netsh trick worked like a champ, a million thanks for the post!
That is great to hear. I spent way too much time trying to get this problem resolved and I’m glad that this was able to help someone else!
Thank you, thank you, thank you. I’m leaving XP soon, but I needed it to work for now, and your note brought me to a quick resolution. If there are any casbahs in your vacinity then step on up - it’s YOUR turn to rock it.
No problem at all and I’m glad it worked for you. Rock the casbah! Rock the casbah!
Thank you so much! You saved me many hours of anguish trying to figure out how I could get the bloody thing to work. Never had this problem before, and all of a sudden…
Glad to hear that it’s now working for you
[...] At this point, it’s fairly clear that it’s not a ruby or rails issue, it’s got to be a windows issue. I google for (out of desperation) “webrick hang” and I see, 4 down, a blog entry called WEBrick Server Hangs in Windows XP - have a look and it recommends running the following command to flush the Winsock Catalogue: [...]
Thanks a bunch. I was totally stuck until I ran across your post. Worked like a charm.
-pgm
yes this did the trick!
they should put this in the documentation…
thanks very much for posting.
I’m glad this helped you out because I almost pulled out all my hair trying to figure this out. I’m glad to know that your WEBrick server is back up and running again.
Thank you!!!! I spent many hours on this ridiculous problem. Your solution worked perfectly. Thanks again Dennis. You are the man!