Ruby `initialize': Invalid argument @ rb_sysopen -url (Errno::EINVAL)

yakczh · July 16, 2016 · Last by 0x2038 replied at July 17, 2016 · 3242 hits

ruby 的 open 打不开 https

require "open-uri"

url='https://segmentfault.com/'

puts open(url).read


提示 `initialize': Invalid argument @ rb_sysopen -url (Errno::EINVAL)

添加 UserAgent 试试

You need to Sign in before reply, if you don't have an account, please Sign up first.