如何要求谷歌API客户端

时间:2018-07-18 07:15:49

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

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

我从Google找到了文档:satheeshwaran

因此,当我安装gem时,在命令rails console之后,我尝试需要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`

1 个答案:

答案 0 :(得分:0)

我不知道为什么,但是在rails console中,当我打电话要求'google / apis'时-它不起作用,但是当我在rails helper中的某些函数中运行时,它就起作用了。

所以,问题已经结束。