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