I copied your app and ran it locally. This happened:
[2014-03-08 22:01:29] INFO WEBrick 1.3.1
[2014-03-08 22:01:29] INFO ruby 2.0.0 (2013-06-27) [x86_64-darwin13.0.0]
[2014-03-08 22:01:29] INFO WEBrick::HTTPServer#start: pid=74593 port=8080
Timer
JSON
HelloWorld
localhost - - [08/Mar/2014:22:01:33 PST] "GET / HTTP/1.1" 200 11
- -> /
Timer
JSON
HelloWorld
localhost - - [08/Mar/2014:22:01:33 PST] "GET /favicon.ico HTTP/1.1" 200 11
- -> /favicon.ico
Timer
JSON
HelloWorld
localhost - - [08/Mar/2014:22:01:33 PST] "GET /favicon.ico HTTP/1.1" 200 11
It seems likely to me that you saw your browser silently requesting a favicon.ico file. Is that possible?
FWIW, whenever I'm debugging something at this low of a level, I always find curl
to be a helpful command.
$ curl -i localhost:8080
HTTP/1.1 200 OK
X-Timing: 2.7e-05
Server: WEBrick/1.3.1 (Ruby/2.0.0/2013-06-27)
Date: Sun, 09 Mar 2014 06:03:58 GMT
Content-Length: 11
Connection: Keep-Alive
hello world%
results in the server printing the following:
[2014-03-08 22:03:49] INFO WEBrick 1.3.1
[2014-03-08 22:03:49] INFO ruby 2.0.0 (2013-06-27) [x86_64-darwin13.0.0]
[2014-03-08 22:03:49] INFO WEBrick::HTTPServer#start: pid=74662 port=8080
Timer
JSON
HelloWorld
localhost - - [08/Mar/2014:22:03:58 PST] "GET / HTTP/1.1" 200 11
- -> /
Huzzah!