Problems running webrick on 1.8.1/OS X 10.3

  • Thread starter David Heinemeier Hansson
  • Start date
D

David Heinemeier Hansson

I'm trying to get Webrick running on Ruby 1.8.1/OS X 10.3, but I'm
experiencing some problems getting even the simplest example to work:

#!/usr/local/bin/ruby
require 'webrick'

s = WEBrick::GenericServer.new( :port => 2000 )
trap("INT"){ s.shutdown }
s.start{|sock|
sock.print(Time.now.to_s + "\r\n")
}

This produces the following error when I hit localhost:2000:

david$ ./daytime_server
[2004-01-13 23:31:32] INFO WEBrick 1.3.1
[2004-01-13 23:31:32] INFO ruby 1.8.1 (2003-12-25) [powerpc-darwin]
[2004-01-13 23:31:32] INFO WEBrick::GenericServer#start: pid=8077
port=2000
[2004-01-13 23:31:38] ERROR SocketError: getnameinfo: System error
/usr/local/lib/ruby/1.8/webrick/server.rb:147:in `peeraddr'
/usr/local/lib/ruby/1.8/webrick/server.rb:147:in `start_thread'
/usr/local/lib/ruby/1.8/webrick/server.rb:144:in `start'
/usr/local/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'
/usr/local/lib/ruby/1.8/webrick/server.rb:94:in `start'
/usr/local/lib/ruby/1.8/webrick/server.rb:89:in `each'
/usr/local/lib/ruby/1.8/webrick/server.rb:89:in `start'
/usr/local/lib/ruby/1.8/webrick/server.rb:79:in `start'
/usr/local/lib/ruby/1.8/webrick/server.rb:79:in `start'
./daytime_server:6

Anyone got a clue?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,150
Members
46,697
Latest member
AugustNabo

Latest Threads

Top