宝石更新不起作用

时间:2018-07-31 22:22:00

标签: ruby windows openssl rubygems

我正试图让红宝石运行。我的公司使用代理服务器:http://proxy.hitachi-id.com:80

我正在使用预编译的红宝石。

我可以添加一个源,但是我不能成功运行gem update

(inst1) (robotframework-Rs4th6sJ) Administrator@DANIE01-ROB1 Z:\Users\danie01\fox\test\watir
# gem sources --add http://rubygems.org
https://rubygems.org is recommended for security over http://rubygems.org

Do you want to add this insecure source? [yn]  y
http://rubygems.org added to sources

(inst1) (robotframework-Rs4th6sJ) Administrator@DANIE01-ROB1 Z:\Users\danie01\fox\test\watir
# gem update --system
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: tlsv1 alert protocol version (https://api.rubygems.org/specs.4.8.gz)

我关注了https://bundler.io/v1.16/guides/rubygems_tls_ssl_troubleshooting_guide.html

我说我需要运行以下命令:

ruby -ropen-uri -e 'eval open("https://git.io/vQhWq").read'

但是此命令失败。

如果我这样做:

Administrator@DANIE01-ROB1 C:\Users\Administrator
# set https_proxy=https://proxy.hitachi-id.com:80

我得到:

Administrator@DANIE01-ROB1 C:\Users\Administrator
# ruby -ropen-uri -e 'eval open("https://git.io/vQhWq").read'
C:/ruby/1.9.3/lib/ruby/1.9.1/open-uri.rb:249:in `open_http': Non-HTTP proxy URI: https://proxy.hitachi-id.com:80 (RuntimeError)
        from C:/ruby/1.9.3/lib/ruby/1.9.1/open-uri.rb:775:in `buffer_open'
        from C:/ruby/1.9.3/lib/ruby/1.9.1/open-uri.rb:203:in `block in open_loop'
        from C:/ruby/1.9.3/lib/ruby/1.9.1/open-uri.rb:201:in `catch'
        from C:/ruby/1.9.3/lib/ruby/1.9.1/open-uri.rb:201:in `open_loop'
        from C:/ruby/1.9.3/lib/ruby/1.9.1/open-uri.rb:146:in `open_uri'
        from C:/ruby/1.9.3/lib/ruby/1.9.1/open-uri.rb:677:in `open'
        from C:/ruby/1.9.3/lib/ruby/1.9.1/open-uri.rb:33:in `open'
        from -e:1:in `<main>'

如果我这样做:

Administrator@DANIE01-ROB1 C:\Users\Administrator
# set https_proxy=http://proxy.hitachi-id.com:80

我得到:

Administrator@DANIE01-ROB1 C:\Users\Administrator
# ruby -ropen-uri -e 'eval open("https://git.io/vQhWq").read'
C:/ruby/1.9.3/lib/ruby/1.9.1/net/http.rb:799:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)
        from C:/ruby/1.9.3/lib/ruby/1.9.1/net/http.rb:799:in `block in connect'
        from C:/ruby/1.9.3/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
        from C:/ruby/1.9.3/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
        from C:/ruby/1.9.3/lib/ruby/1.9.1/net/http.rb:799:in `connect'
        from C:/ruby/1.9.3/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
        from C:/ruby/1.9.3/lib/ruby/1.9.1/net/http.rb:744:in `start'
        from C:/ruby/1.9.3/lib/ruby/1.9.1/open-uri.rb:306:in `open_http'
        from C:/ruby/1.9.3/lib/ruby/1.9.1/open-uri.rb:775:in `buffer_open'
        from C:/ruby/1.9.3/lib/ruby/1.9.1/open-uri.rb:203:in `block in open_loop'
        from C:/ruby/1.9.3/lib/ruby/1.9.1/open-uri.rb:201:in `catch'
        from C:/ruby/1.9.3/lib/ruby/1.9.1/open-uri.rb:201:in `open_loop'
        from C:/ruby/1.9.3/lib/ruby/1.9.1/open-uri.rb:146:in `open_uri'
        from C:/ruby/1.9.3/lib/ruby/1.9.1/open-uri.rb:677:in `open'
        from C:/ruby/1.9.3/lib/ruby/1.9.1/open-uri.rb:33:in `open'
        from -e:1:in `<main>'

0 个答案:

没有答案