我想让用户在我的应用上访问自己的Google云端硬盘存储空间。我已按照Google quick-start website的说明进行了操作,但我一直收到此错误:
C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:923:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (Faraday::SSLError)
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:923:in `block in connect'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/timeout.rb:73:in `timeout'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:923:in `connect'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:863:in `do_start'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:852:in `start'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:1375:in `request'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/adapter/net_http.rb:82:in `perform_request'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/adapter/net_http.rb:40:in `block in call'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/adapter/net_http.rb:87:in `with_net_http_connection'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/adapter/net_http.rb:32:in `call'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/request/url_encoded.rb:15:in `call'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/rack_builder.rb:139:in `build_response'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/connection.rb:377:in `run_request'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/faraday-0.9.2/lib/faraday/connection.rb:177:in `post'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/signet-0.7.3/lib/signet/oauth_2/client.rb:960:in `fetch_access_token'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/signet-0.7.3/lib/signet/oauth_2/client.rb:998:in `fetch_access_token!'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/googleauth-0.5.1/lib/googleauth/signet.rb:69:in `fetch_access_token!'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/googleauth-0.5.1/lib/googleauth/user_authorizer.rb:179:in `get_credentials_from_code'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/googleauth-0.5.1/lib/googleauth/user_authorizer.rb:201:in `get_and_store_credentials_from_code'
from quickstart.rb:36:in `authorize'
from quickstart.rb:45:in `<main>'
我尝试从http://curl.haxx.se/ca/cacert.pem
下载证书并将其作为SSL_CERT_FILE
添加到我的系统环境中,但我仍然遇到同样的错误。另外,当我更新到RubyGem 2.6.7时,我得到了相同的结果。
我还意识到'quickstart.rb'创建的'drive-ruby-quickstart.yaml'文件是空白的。即使我确实设法在Linux,Fedora 23上正确存储'drive-ruby-quickstart.yaml',它也让我想到了这个:
/home/username/.gem/ruby/gems/google-api-client-0.9.19/lib/google/apis/core/http_command.rb:208:in`check_status':未经授权(Google :: Apis) :: AuthorizationError)
我已经这样做了几个星期但仍然无法解决它。请帮忙。
我主要在Windows 10上测试,而我的RubyGem版本是2.6.7。我已经尝试过Ruby版本2.2.3和2.3.1,以及Rails 5.0.0.1。