"uninitialized constant Google::Apis" 调用时 google API

"uninitialized constant Google::Apis" when calling google API

https://developers.google.com/google-apps/calendar/quickstart/ruby api 用于 google 日历和活动列表。

当 运行 该代码在 SCOPE = Google::Apis::CalendarV3::AUTH_CALENDAR_READONLY

处出现此错误时

我有 google-api-客户端 (= 0.8.2) gem

我看到您使用的是 0.8.2 gem。根据这个 google github post,你应该使用

  Google::APIClient.new

而不是

  Google::Apis