Forum: Ruby undefined method(s) in a gcalapi class

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
11bffb04a727548fe63894fe17196370?d=identicon&s=25 kevin lee (kaiwen)
on 2007-06-28 20:14
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/priva...
MAIL = "my_email_address"
PASS = "my_password"
FEED =
"http://www.google.com/calendar/feeds/my_email_addr...

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!
This topic is locked and can not be replied to.