Search code examples
rubyunicorn

Address family not supported by protocol family


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?


Solution

  • 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.