# cronotab.rb — Crono configuration file
#
# Here you can specify periodic jobs and schedule.
# You can use ActiveJob's jobs from `app/jobs/`
# You can use any class. The only requirement is that
# class should have a method `perform` without arguments.
#
class TestJob
def perform
puts 'Test!'
end
end
#
Crono.perform(TestJob).every 2.days, at: '15:30'
#
Rails Version 4.0.0
Ruby Version 2.1.0p0
Originally created by @abdullah353 on GitHub (Mar 3, 2016).
After Following your installation steps i am receiving this error.
```
bundle exec crono
```
```
undefined method `compact' for {:hour=>15, :min=>30}:Hash
/usr/local/lib/ruby/gems/2.1.0/gems/crono-0.9.0/lib/crono/period.rb:68:in `time_atts'
/usr/local/lib/ruby/gems/2.1.0/gems/crono-0.9.0/lib/crono/period.rb:32:in `initial_next'
/usr/local/lib/ruby/gems/2.1.0/gems/crono-0.9.0/lib/crono/period.rb:14:in `next'
/usr/local/lib/ruby/gems/2.1.0/gems/crono-0.9.0/lib/crono/job.rb:16:in `initialize'
/usr/local/lib/ruby/gems/2.1.0/gems/crono-0.9.0/lib/crono/performer_proxy.rb:10:in `new'
/usr/local/lib/ruby/gems/2.1.0/gems/crono-0.9.0/lib/crono/performer_proxy.rb:10:in `every'
/var/www/billgist/web_app/config/cronotab.rb:14:in `<top (required)>'
/usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
/usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
/usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
/usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
/usr/local/lib/ruby/gems/2.1.0/gems/crono-0.9.0/lib/crono/cronotab.rb:7:in `process'
/usr/local/lib/ruby/gems/2.1.0/gems/crono-0.9.0/lib/crono/cli.rb:24:in `run'
/usr/local/lib/ruby/gems/2.1.0/gems/crono-0.9.0/exe/crono:8:in `<top (required)>'
/usr/local/bin/crono:23:in `load'
/usr/local/bin/crono:23:in `<main>'
```
> cat **_config/cronotab.rb**_
>
> ```
> # cronotab.rb — Crono configuration file
> #
> # Here you can specify periodic jobs and schedule.
> # You can use ActiveJob's jobs from `app/jobs/`
> # You can use any class. The only requirement is that
> # class should have a method `perform` without arguments.
> #
> class TestJob
> def perform
> puts 'Test!'
> end
> end
> #
> Crono.perform(TestJob).every 2.days, at: '15:30'
> #
> ```
Rails Version 4.0.0
Ruby Version 2.1.0p0
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @abdullah353 on GitHub (Mar 3, 2016).
After Following your installation steps i am receiving this error.
Rails Version 4.0.0
Ruby Version 2.1.0p0
@abdullah353 commented on GitHub (Mar 4, 2016):
After upgrading _Rails to 4.1.0_ i am getting this error, It's because of gem protected_attributes that i am using. instead of strong parameter
Then After Migrating to _Rails 4.2.0_ it's working now