Crono not working with Ruby 3.0 #69

Closed
opened 2025-12-29 00:22:13 +01:00 by adam · 0 comments
Owner

Originally created by @trustarun on GitHub (Jul 1, 2022).

I am using below env:

Ruby -> 3.0.0p0
Rails -> 6.1.6
Crono -> 2.0.0

I am getting below error while running the Test job mentioned in its document:

I, [2022-07-01T20:34:39.036394 #4638] INFO -- : Perform Test
E, [2022-07-01T20:34:39.037945 #4638] ERROR -- : Finished Test in 0.00 seconds with error: wrong number of arguments (given 1, expected 0)

The job I have defined in crontab as per its doc
`
require 'rake'

Rails.app_class.load_tasks

class Test
def perform
Rake::Task['crono:hello'].execute
end
end

Crono.perform(Test).every 5.seconds`

I have aslo define the rake task in lib/tasks/test.rake as needed
namespace :crono do desc 'Update all tables' task :hello => :environment do puts "hello" end end

Do we have any way to fix this?
My application heavily based on job scheduling and this issue of crono with Ruby 3.0 preventing me from upgrading my app to Ruby 3

Originally created by @trustarun on GitHub (Jul 1, 2022). I am using below env: Ruby -> 3.0.0p0 Rails -> 6.1.6 Crono -> 2.0.0 I am getting below error while running the Test job mentioned in its document: I, [2022-07-01T20:34:39.036394 #4638] INFO -- : Perform Test E, [2022-07-01T20:34:39.037945 #4638] ERROR -- : Finished Test in 0.00 seconds with error: wrong number of arguments (given 1, expected 0) The job I have defined in crontab as per its doc ` require 'rake' Rails.app_class.load_tasks class Test def perform Rake::Task['crono:hello'].execute end end Crono.perform(Test).every 5.seconds` I have aslo define the rake task in lib/tasks/test.rake as needed ` namespace :crono do desc 'Update all tables' task :hello => :environment do puts "hello" end end ` Do we have any way to fix this? My application heavily based on job scheduling and this issue of crono with Ruby 3.0 preventing me from upgrading my app to Ruby 3
adam closed this issue 2025-12-29 00:22:13 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/crono#69