Whenever tasks not running on Rails 4
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 8.9k
- Forks
- 715
- PR merge metrics
- No merged PRs in 30d
Description
Googled around a bunch and couldn't find a good answer for this.
I set up whenever per the docs in my rails 4.1.6 app, and am having it run a simple task in schedule.rb:
set :output, "#{path}/log/cron.log"
every 15.minutes do
runner "Order.sync_orders"
end
Order.rb:
#other crap
def self.sync_orders
#do stuff
end
Running 'whenever' results in the output:
0,15,30,45 * * * * /bin/bash -l -c 'cd /Users/zach/Apps/myapp && bin/rails runner -e development '\''Order.sync_orders'\'' >> /Users/me/Apps/myapp/log/cron.log 2>&1'
## [message] Above is your schedule file converted to cron syntax; your crontab file was not updated.
## [message] Run `whenever --help' for more options.
The cron.log file is not written to, nor does the method actually get called. The output of crontab -l does indeed list the job there.
Thoughts?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with schedule.rb and the generated command shown in the issue, then compare it with crontab -l and the bin/rails runner entry point. Reproduce the schedule and inspect cron.log; done means the scheduled Order.sync_orders task runs and produces the expected log output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rails, ruby
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100