javan/whenever — Issue #192: Whenever bundler issue?
Author: rafaldyrda
Created: 2011-10-29 04:45:43+00:00
State: open

Ok, not sure if this is an issue or not, just don't know what to do anymore, maybe someone here can help.

Running Ruby 1.9.2, Rails 3.0.10. No RVM.

``````
schedule.rb

every 1.hour do
runner "SessionCleaner.remove_stale_sessions"
end
`````

Produces this cron job

`````
0 * * * * /bin/bash -l -c 'cd /home/user/apps/app/releases/20111028220039 && script/rails runner -e production '\''SessionCleaner.remove_stale_sessions'\'''
`````

When it tries to run I get this error

````
.../shared/bundle/ruby/1.9.1/gems/railties-3.0.10/lib/rails/commands/runner.rb:50:in `eval': uninitialized constant SessionCleaner (NameError)

from ..../shared/bundle/ruby/1.9.1/gems/railties-3.0.10/lib/rails/commands/runner.rb:50:in `eval'
from ..../shared/bundle/ruby/1.9.1/gems/railties-3.0.10/lib/rails/commands/runner.rb:50:in `'
from ..../shared/bundle/ruby/1.9.1/gems/railties-3.0.10/lib/rails/commands.rb:39:in `require'
from ..../shared/bundle/ruby/1.9.1/gems/railties-3.0.10/lib/rails/commands.rb:39:in `'
from script/rails:6:in `require'
from script/rails:6:in `

'
`````
I really hope someone can shed some light on this. Thanks in advance.