Ruby Google API客户端错误:Google::APIClient::ClientError

Ruby Google API客户端错误:Google::APIClient::ClientError,ruby,google-drive-api,google-api-client,Ruby,Google Drive Api,Google Api Client,我已经将GoogleDrive与我的应用程序集成在一起,直到今天都运行良好。我没有更改任何代码或客户端ID,现在在我们的网站上授权GDrive时出现以下错误: Google::APIClient::ClientError 无法在以下位置检索发现文档: 我使用的是Ruby Google Api客户端,下面是引发错误的代码: require 'google/api_client' gclient ||= (begin client = Google::APIClient.n

我已经将GoogleDrive与我的应用程序集成在一起,直到今天都运行良好。我没有更改任何代码或客户端ID,现在在我们的网站上授权GDrive时出现以下错误:

Google::APIClient::ClientError

无法在以下位置检索发现文档:

我使用的是Ruby Google Api客户端,下面是引发错误的代码:

require 'google/api_client'

      gclient ||= (begin
      client = Google::APIClient.new
      client.authorization.client_id = Rails.application.config.gdrive_client_id
      client.authorization.client_secret = Rails.application.config.gdrive_client_secret
      client.authorization.redirect_uri = "#{request.protocol}#{Rails.application.config.host_url}/users/auth/gdrive"
      client.authorization.access_token = auth_token.token
      client.authorization.scope = [
        "https://www.googleapis.com/auth/drive",
        "https://www.googleapis.com/auth/userinfo.email",
        "https://www.googleapis.com/auth/userinfo.profile"
      ]
      client
    end)
    result = gclient.execute!(
      :api_method => 'oauth2.userinfo.get',
      :version => 'v2'
    )

错误出现在“result=gclient.execute!”。Google Ruby API客户端库中有什么变化吗?

没有-Ruby库中没有任何变化。这是由于谷歌在网站上提供的Web服务发生了变化

我知道这一点,因为我今天在python API库中遇到了同样的问题

我发现了一个解决方法,那就是避免使用发现服务,直接点击URL。OAuth2 userinfo服务的URL为

这不是一个很好的长期解决方案,但希望在谷歌修复他们的发现服务之前,你能坚持下去

更新-看起来现在已经备份了(截至太平洋标准时间8月16日2:07PST)

以前有

{ “id”:“oauth:v2”, “名称”:“oauth”, “版本”:“v2” ... }

它现在不在那里。这就是问题所在


这是问题的征兆。

看起来这是谷歌的问题,我在尝试用其他几个应用程序打开谷歌硬盘映像时遇到了完全相同的错误。导致问题的更改已回滚。现在一切正常。