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?
This error will usually indicate there is a problem with the loopback interface containing an invalid address. Often, the issue is that IPv6 is disabled, but the localhost entry contains an IPv6 address like ::1.
Address family protocols provide the network transportation of application data from one application to another (or from one process to another within the same system). The application specifies the network transport provider on the protocol parameter of the socket.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With