undefined method(s) in a gcalapi class

K

kevin lee

Hi, I am using the gcalapi v 0.1.0 library and ran into a error when I
called the add action. It generated "NoMethodError in
EventController#Add undefined method `insert' for
GoogleCalendar::ServiceBase:Class" error message.
I tried other methods in the googlecalendar/service_base class but got
the same error. The class file is correctly installed and using methods
of other classes do not cause this problem. I am dumbfounded. Is this
a configuration problem?
My rails version is 1.2.3 and ruby version is 1.8.6. Please help!
Below is code to illustrate my problem:

require "..."
require "googlecalendar/service_auth_sub"
require "googlecalendar/auth_sub_util"
require "googlecalendar/calendar"
require "googlecalendar/service"
require "googlecalendar/service_base"

REQUEST_URL = "https://www.google.com/accounts/AuthSubRequest"
SESSION_URL = "https://www.google.com/accounts/AuthSubSessionToken"
REVOKE_URL = "https://www.google.com/accounts/AuthSubRevokeToken"
INFO_URL = "https://www.google.com/accounts/AuthSubTokenInfo"
CALENDAR_SCOPE = "http://www.google.com/calendar/feeds/"
DEFAULT_CALENDAR_FEED =
"http://www.google.com/calendar/feeds/default/private/full"
MAIL = "my_email_address"
PASS = "my_password"
FEED =
"http://www.google.com/calendar/feeds/my_email_address/private/full"

class EventController < ApplicationController

def Add

...

request_url =
GoogleCalendar::AuthSubUtil.build_request_url("http://127.0.0.1:3000/event/index",
"http://www.google.com/calendar/feeds/", 0, 1)

...

one_time_token =
GoogleCalendar::AuthSubUtil.get_one_time_token(page.links.first.href)

...

srv = GoogleCalendar::ServiceAuthSub.new(one_time_token)

ret = srv.query(FEED, {})


cal = GoogleCalendar::Calendar.new(GoogleCalendar::Service.new(MAIL,
PASS), DEFAULT_CALENDAR_FEED)

...

GoogleCalendar::ServiceBase.insert(FEED, event)

end


end

Thanks in advance!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,244
Latest member
cryptotaxsoftware12

Latest Threads

Top