More DRb Fun

K

Kevin Brown

I'm not sure why I'm having so much fun with DRb, really:

kevin@itzamna:~/drb$ ./server.rb
/usr/lib/ruby/1.8/drb/drb.rb:837:in `getaddrinfo': getaddrinfo: Name
or service not known (SocketError)
from /usr/lib/ruby/1.8/drb/drb.rb:837:in `open_server_inaddr_any'
from /usr/lib/ruby/1.8/drb/drb.rb:860:in `open_server'
from /usr/lib/ruby/1.8/drb/drb.rb:756:in `open_server'
from /usr/lib/ruby/1.8/drb/drb.rb:754:in `each'
from /usr/lib/ruby/1.8/drb/drb.rb:754:in `open_server'
from /usr/lib/ruby/1.8/drb/drb.rb:1335:in `initialize'
from /usr/lib/ruby/1.8/drb/drb.rb:1624:in `new'
from /usr/lib/ruby/1.8/drb/drb.rb:1624:in `start_service'
from ./server.rb:9
kevin@itzamna:~/drb$ cat server.rb
#!/usr/bin/env ruby
# simple_service.rb
# A simple DRb service

# load DRb
require 'drb'

# start up the DRb service
DRb.start_service nil, []

# We need the uri of the service to connect a client
puts DRb.uri

# wait for the DRb service to finish before exiting
DRb.thread.join

This is on a fresh install of Debian Sarge, and I'm pretty sure I've
grabbed all the Debian Ruby portions off of apt-get...

Any ideas why I'm having this trouble?
 
K

Konstantin Levinski

My guess would be -

-DRb.start_service nil, []
+DRb.start_service "druby://0.0.0.0:10001", []

so that druby knows which port to use.
 
K

Kevin Brown

Here I go solving my own problems again.

The thing that threw me was the error message. Turns out the problem
was that the wrong hostname was in the top line of /etc/hosts, so the
host name of the machine wasn't mapping to 127.0.0.1.
 

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,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top