Ruby Net::OpenTimeout: execution expired

后端 未结 3 1299
借酒劲吻你
借酒劲吻你 2021-02-20 04:53

I\'m consistently getting this error on several hosts on my machine, e.g.:

require \'open-uri\'
open(\'https://google.com\').read


Net::OpenTimeout: execution e         


        
3条回答
  •  一个人的身影
    2021-02-20 05:14

    I've hit another reason for this issue. Had a network where IPv6 is announced as routable but is not. That lead to IPv6 trying to be used resulting in the error.

    So I had to disable IPv6.

    For Red Hat Enterprise Linux 7:

    # cat /etc/sysctl.d/10-ipv6.conf 
    net.ipv6.conf.all.disable_ipv6 = 1
    net.ipv6.conf.default.disable_ipv6 = 1
    # sysctl -p
    

    The require 'resolv-replace' also helped but my guess is that it just resolved to IPv4 instead so I don't want to limit app in such a way.

提交回复
热议问题