3

I got this message -> "[fail] Can't find file: config/schedule.rb"

I'm using "whenever" gem -> https://github.com/javan/whenever

I did put it in my Gemfile

gem 'whenever', :require => false

then wheneverize .

& I have file in config/schedule.rb with

every 2.hours do
  rake "thinking_sphinx:index"
end

When I run -> "whenever" or "whenever --update-crontab mycron --set environment=development" or "whenever --update-crontab mycron" I get this msg -> "[fail] Can't find file: config/schedule.rb"

Thank you.

whitesiroi
  • 2,725
  • 4
  • 30
  • 64
  • are you in the rails directory when you ran `whenever`? – jvnill Mar 05 '13 at 02:49
  • Thank you very much :) I was in the config folder:) Maybe you can post it as an answer & I'll vote. It was so easy :) – whitesiroi Mar 05 '13 at 02:51
  • hehe someone posted it as an answer. too bad for me. i'll still add it anyway. it's up to you to mark it as an answer or not :) – jvnill Mar 05 '13 at 03:08

2 Answers2

4

The issue is you're probably not in the rails root directory so going to the root path should fix your issue.

jvnill
  • 29,479
  • 4
  • 83
  • 86
2

Can you try with?

cd /my_rails_application_root_path && bundle exec whenever

You can check the binary source code at https://github.com/cwninja/whenever/blob/master/bin/whenever

If you don't pass the attribute -f, it will use config/schedule.rb by default, but you can also run

whenever -f COMPLETE_PATH_TO_SCHEDULE_RB
rorra
  • 9,593
  • 3
  • 39
  • 61