我已正确设置环境变量SSL_CERT_FILE - 此处为set的cmd输出:
SSL_CERT_FILE = C:\ RailsInstaller \ cacert.pem
这是我在cacert.pem中的链接:cacert.pem
这是运行irb:
的cmd窗口输出C:\Users\anon\prog\workspace>irb
irb(main):001:0> require 'open-uri'
=> true
irb(main):002:0> open ('https://www.youtube.com')
OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/net/http.rb:923:in `connect'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/net/http.rb:923:in `block in connect'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/timeout.rb:75:in `timeout'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/net/http.rb:923:in `connect'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/net/http.rb:863:in `do_start'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/net/http.rb:852:in `start'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/open-uri.rb:313:in `open_http'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/open-uri.rb:724:in `buffer_open'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/open-uri.rb:210:in `block in open_loop'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/open-uri.rb:208:in `catch'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/open-uri.rb:208:in `open_loop'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/open-uri.rb:149:in `open_uri'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/open-uri.rb:704:in `open'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/open-uri.rb:34:in `open'
from (irb):2
from C:/RailsInstaller/Ruby2.1.0/bin/irb:11:in `<main>'
irb(main):003:0>