سؤال

I tried to do the ruby example shown in this page: http://tomayko.com/writings/unicorn-is-unix

but all I got was

echo.rb:9:in `bind': Address family not supported by protocol family - bind(2) (Errno::EAFNOSUPPORT)
    from echo.rb:9:in `<main>'

Any idea?

هل كانت مفيدة؟

المحلول

I've encountered the same problem. Just change the localhost to 0.0.0.0:

address = Socket.pack_sockaddr_in(4242, '0.0.0.0')

It seems to appear on Mac only.

نصائح أخرى

You cannot use domain names in this method, you must use IP addresses:

  • 127.0.0.1 for localhost
  • 0.0.0.0 for all interfaces

You might want to check in at http://rubyforge.org/mailman/listinfo/mongrel-unicorn and ask there.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top