我正尝试使用gem“gcal4ruby”,“0.5.4”从google calender中获取日历细节,然后在rails视图页面中显示这些信息。我正在关注(http://blog.pebbleit.com/post/540819239/fetching-and-caching-google-calendar-data-in-rails)George Ornbo的帖子。在rails视图中显示谷歌日历事件
class CalendarController < ApplicationController
service = GCal4Ruby::Service.new
service.authenticate("USERNAME", "PASSWORD")
cal = GCal4Ruby::Calendar.find(
service,
'YOUR_CALENDAR',
{:scope => :first}
)
events = GCal4Ruby::Event.find(
cal,
"",
{
:range => {:start => Time.parse("08/04/2000"),
:end => Time.parse("09/04/2010")}
}
)
end
我替换了用户名,密码,服务,开始时间和结束时间。当执行此我收到以下错误
undefined method `calendars' for []:Array
app/controllers/calendar_controller.rb:12:in `event_display'
任何人都可以帮助我
谢谢!为我工作 – vinothini