【问题标题】:Tool google-api from google-api-client not working来自 google-api-client 的工具 google-api 不起作用
【发布时间】:2014-02-22 09:56:23
【问题描述】:

我想制作一个能够访问我的 Google 日历的简短工具。因此我必须使用 google-api-client gem。当我查看已安装的 gem 时,我看到了。
在我可以使用提供的类和方法之前,我必须使用我的 clientID 和 clientSecret 以及其他一些东西创建一个 YAML 文件。因此,gem 应该有一个名为“google-api”的 cli 工具。如果我现在要创建此文件,我总是会收到消息 google-api: command not found。
如果这很重要,我会使用 rvm。但我已经检查过我是否有合适的宝石可用。
(我必须做的一切,我在这里找到:https://developers.google.com/google-apps/calendar/instantiate?hl=de

【问题讨论】:

    标签: ruby google-api


    【解决方案1】:

    我也遇到了同样的问题。 您安装了 google-api-client gem 的哪个版本?我想你可能已经安装了最新版本。 它从 0.7.0 版中删除了 bin 文件。(参见此处:https://github.com/google/google-api-ruby-client/blob/master/CHANGELOG.md#070) 如果您需要该命令,请使用以下命令重新安装:“gem uninstall google-api-client; gem install google-api-client -v 0.6.4”。

    【讨论】:

    • 很好,你为我节省了很多时间。为你点赞。
    • 这为我安装了二进制文件。现在,当我运行二进制文件时,我收到错误Could not find jwt (~> 0.1.4)。我解决这个错误的方法是安装jwt gem 版本0.1.5,然后删除jwt gem 版本1.0.0。
    • 我也降级了我的版本,它工作了!但是现在,当我按照命令 google-api oauth-2-login --scope=googleapis.com/auth/calendar --client-id=CLIENT_ID --client-secret=CLIENT_SECRET 提供客户端密钥和密码时,我收到 400 错误在我的浏览器上。我假设 CLIENT_SECRET 是密码? “错误:redirect_uri_mismatch 请求中的重定向 URI:localhost:12736 与注册的重定向 URI 不匹配。”那是我得到的错误。任何帮助将不胜感激
    • 您需要在 Google 开发者控制台中注册该回调 URI。访问您的应用程序->APIs & Auth->凭证。浏览器将重定向到该位置,以将身份验证令牌传递回您的应用程序。新注册可能需要几分钟时间。
    猜你喜欢
    • 2020-03-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-03
    • 1970-01-01
    • 1970-01-01
    • 2011-09-16
    • 2016-12-19
    相关资源
    最近更新 更多