amitree / delayed_job_recurring

Extends delayed_job to support recurring jobs
MIT License
84 stars 33 forks source link

NoMethodError: undefined method `parse' for nil:NilClass in parse_time #37

Open xeruf opened 1 year ago

xeruf commented 1 year ago

Heyo! I am unable to integrate this Gem in a legacy project, seems another version constraint is needed.

Extract from Gemfile.lock:

delayed_job (4.1.10)
  activesupport (>= 3.0, < 8.0)
delayed_job_active_record (4.1.7)
  activerecord (>= 3.0, < 8.0)
  delayed_job (>= 3.0, < 5)
delayed_job_recurring (0.2)
  delayed_job (>= 4.0)
  delayed_job_active_record (>= 4.0)
delorean (2.1.0)
  chronic

Got this errir in Version 0.2, 0.3.7, 0.3.9:

[2] pry(main)> DailyJob.schedule!
  Delayed::Backend::ActiveRecord::Job Load (0.9ms)  SELECT `delayed_jobs`.* FROM `delayed_jobs` WHERE (((handler LIKE '--- !ruby/object:DailyJob %') OR (handler LIKE '--- !ruby/object:DailyJob\n%')))
NoMethodError: undefined method `parse' for nil:NilClass
from /usr/local/lib/app-bundle/gems/delayed_job_recurring-0.3.7/lib/delayed/recurring_job.rb:95:in `parse_time'

Using the Example Code.

xeruf commented 1 year ago

Oh, the actual issue was that it did not recognize the 'am' as I am in a European (German) locale. Would be good to adjust that.