Parameters Error #64

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

Originally created by @hiveer on GitHub (Apr 26, 2022).

$ bundle exec crono RAILS_ENV=development
wrong number of arguments (given 2, expected 1)
/Users/hiveerli/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/crono-1.1.2/lib/crono/period.rb:7:in `initialize'
/Users/hiveerli/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/crono-1.1.2/lib/crono/performer_proxy.rb:11:in `new'
/Users/hiveerli/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/crono-1.1.2/lib/crono/performer_proxy.rb:11:in `every'
/Users/hiveerli/works/jihu-partner-portal/config/cronotab.rb:15:in `<main>'
/Users/hiveerli/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/Users/hiveerli/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'

My configuration is like this:

Crono.perform(OppReportWeeklyJob).every 1.week, on: :tuesday, at: "8:30"
Originally created by @hiveer on GitHub (Apr 26, 2022). ```ruby $ bundle exec crono RAILS_ENV=development wrong number of arguments (given 2, expected 1) /Users/hiveerli/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/crono-1.1.2/lib/crono/period.rb:7:in `initialize' /Users/hiveerli/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/crono-1.1.2/lib/crono/performer_proxy.rb:11:in `new' /Users/hiveerli/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/crono-1.1.2/lib/crono/performer_proxy.rb:11:in `every' /Users/hiveerli/works/jihu-partner-portal/config/cronotab.rb:15:in `<main>' /Users/hiveerli/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' /Users/hiveerli/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' ``` My configuration is like this: ```ruby Crono.perform(OppReportWeeklyJob).every 1.week, on: :tuesday, at: "8:30" ```
adam closed this issue 2025-12-29 00:22:10 +01:00
Author
Owner

@plashchynski commented on GitHub (May 29, 2022):

Hello @hiveer, could you please check it with a new version of the gem (2.0.0) and report back if the problem is still persist. Thank you!

@plashchynski commented on GitHub (May 29, 2022): Hello @hiveer, could you please check it with a new version of the gem (2.0.0) and report back if the problem is still persist. Thank you!
Author
Owner

@anko20094 commented on GitHub (Jun 15, 2022):

For:

class TestJob
  def perform
    puts 'Test!'
  end
end

Crono.perform(TestJob).every 5.seconds

I have error:

I, [2022-06-15T13:48:24.697900 #56713]  INFO -- : Perform TestJob
E, [2022-06-15T13:48:24.698774 #56713] ERROR -- : Finished TestJob in 0.00 seconds with error: wrong number of arguments (given 1, expected 0)
E, [2022-06-15T13:48:24.698811 #56713] ERROR -- : /home/danyil/Desktop/telegram_bot_app/config/cronotab.rb:9:in `perform'
@anko20094 commented on GitHub (Jun 15, 2022): For: ``` class TestJob def perform puts 'Test!' end end Crono.perform(TestJob).every 5.seconds ``` I have error: ``` I, [2022-06-15T13:48:24.697900 #56713] INFO -- : Perform TestJob E, [2022-06-15T13:48:24.698774 #56713] ERROR -- : Finished TestJob in 0.00 seconds with error: wrong number of arguments (given 1, expected 0) E, [2022-06-15T13:48:24.698811 #56713] ERROR -- : /home/danyil/Desktop/telegram_bot_app/config/cronotab.rb:9:in `perform' ```
Author
Owner

@plashchynski commented on GitHub (Jun 16, 2022):

Hello @anko20094 thank you for the reporting. It should be fixed in the master.

@plashchynski commented on GitHub (Jun 16, 2022): Hello @anko20094 thank you for the reporting. It should be fixed in the master.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/crono#64