【问题标题】:How to require google api client如何要求 google api 客户端
【发布时间】:2018-07-18 16:01:40
【问题描述】:

我正在使用google-api-client gem 在 Google 日历中创建活动。

我从谷歌找到了文档:https://developers.google.com/calendar/quickstart/ruby

所以,当我安装 gem 时,在命令 rails console 之后,我尝试了 require libs:

require 'google/api_client', 
require 'google/apis',
require 'google/apis/calendar_v3'

在每个require 我得到 错误:LoadError: cannot load such file

宝石信息:

bundle info google-api-client

google-api-client (0.23.4)
Summary: Client for accessing Google APIs
Homepage: https://github.com/google/google-api-ruby-client
Path: /Users/danielsaifulin/.rvm/gems/ruby-2.4.0-rc1@sortd/gems/google-api-client-0.23.4`

【问题讨论】:

    标签: google-api-client ruby-on-rails-4.2 ruby-2.4


    【解决方案1】:

    我不知道为什么,但是在 rails console 中,当我调用 require 'google/apis' 时,它不起作用,但是当我在 rails helper 中的某个函数中运行时,它就起作用了。

    所以,问题结束了。

    【讨论】:

      猜你喜欢
      • 2012-08-15
      • 1970-01-01
      • 1970-01-01
      • 2013-02-23
      • 2015-05-26
      • 1970-01-01
      • 1970-01-01
      • 2017-04-02
      • 1970-01-01
      相关资源
      最近更新 更多