Skip to content

uninitialized constant Enumerable::Enumerator #19

@rahulsom

Description

@rahulsom

I'm trying to look at recurrences of a calendar event and running into that error

Here's my code

  calendars = Vpim::Icalendar.decode(ics)
  calendars.each do |calendar|
    cal_data = calendar.
        select  { |event| event.occurs_in?(Time.now, Time.now + 86400 * 10) }.
        collect { |event| event_hash(event) }.
        sort_by { |event| event['end'] }.
        each    { |event| puts event }
  end

The full trace is here

/opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/vpim-13.11.11/lib/vpim/property/recurrence.rb:40:in `occurrences': uninitialized constant Enumerable::Enumerator (NameError)
    from jobs/confluence_calendar.rb:44:in `block (3 levels) in <main>'
    from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/vpim-13.11.11/lib/vpim/icalendar.rb:347:in `block in components'
    from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/vpim-13.11.11/lib/vpim/icalendar.rb:345:in `each'
    from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/vpim-13.11.11/lib/vpim/icalendar.rb:345:in `components'
    from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/vpim-13.11.11/lib/vpim/icalendar.rb:364:in `each'
    from jobs/confluence_calendar.rb:43:in `select'
    from jobs/confluence_calendar.rb:43:in `block (2 levels) in <main>'
    from jobs/confluence_calendar.rb:40:in `each'
    from jobs/confluence_calendar.rb:40:in `block in <main>'
    from jobs/confluence_calendar.rb:34:in `each'
    from jobs/confluence_calendar.rb:34:in `<main>'

I'm using ruby 2.1.2 and vpim 13.11.11 if that makes a difference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions