$ gem sources -a https://ruby.taobao.org/ 报错

问题描述

$ gem sources -a https://ruby.taobao.org/ 报错

$ gem sources -a https://ruby.taobao.org/ --debug
NOTE: Debugging mode prints all exceptions even when rescued
Exception NameError' at C:/Ruby22-x64/lib/ruby/2.2.0/fiddle/import.rb:153 - uninitialized constant Fiddle::Function::STDCALL
Exception
Win32::Registry::Error' at C:/Ruby22-x64/lib/ruby/2.2.0/win32/registry.rb:249 - The system cannot find the file specified.
Exception Win32::Registry::Error' at C:/Ruby22-x64/lib/ruby/2.2.0/win32/registry.rb:249 - The system cannot find the file specified.
Exception
Win32::Registry::Error' at C:/Ruby22-x64/lib/ruby/2.2.0/win32/registry.rb:249 - The system cannot find the file specified.
Exception Win32::Registry::Error' at C:/Ruby22-x64/lib/ruby/2.2.0/win32/registry.rb:249 - No more data is available.
Exception
Resolv::DNS::Config::NXDomain' at C:/Ruby22-x64/lib/ruby/2.2.0/resolv.rb:546 - _rubygems._tcp.ruby.taobao.org
Exception Resolv::DNS::Config::NXDomain' at C:/Ruby22-x64/lib/ruby/2.2.0/resolv.rb:546 - _rubygems._tcp.ruby.taobao.org.beijing.objectiva.local
Exception
Resolv::DNS::Config::NXDomain' at C:/Ruby22-x64/lib/ruby/2.2.0/resolv.rb:546 - _rubygems._tcp.ruby.taobao.org.Objectiva.local
Exception Resolv::ResolvError' at C:/Ruby22-x64/lib/ruby/2.2.0/resolv.rb:491 - DNS result has no information for _rubygems._tcp.ruby.taobao.org
Exception
Errno::EEXIST' at C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:252 - File exists @ dir_s_mkdir - C:/Users/winstonqiao/.gem/specs/ruby.taobao.org%443
Exception Errno::ENOENT' at C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/remote_fetcher.rb:306 - No such file or directory @ rb_file_s_stat - C:/Users/winstonqiao/.gem/specs/ruby.taobao.org%443/specs.4.8
Exception
OpenSSL::SSL::SSLErrorWaitReadable' at C:/Ruby22-x64/lib/ruby/2.2.0/openssl/buffering.rb:182 - read would block
Exception OpenSSL::SSL::SSLError' at C:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:923 - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
Exception
OpenSSL::SSL::SSLError' at C:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:931 - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
Exception Gem::RemoteFetcher::FetchError' at C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/request.rb:88 - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems-china.oss-cn-hangzhou.aliyuncs.com/specs.4.8.gz)
Exception
Gem::RemoteFetcher::FetchError' at C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/remote_fetcher.rb:285 - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems-china.oss-cn-hangzhou.aliyuncs.com/specs.4.8.gz)
Error fetching https://ruby.taobao.org/:
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems-china.oss-cn-hangzhou.aliyuncs.com/specs.4.8.gz)

解决方案

$ gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/
$ gem sources -l

时间: 2024-11-08 21:10:59