3

我收到此消息 ->“[失败] 找不到文件:config/schedule.rb”

我正在使用“无论何时” gem - > https://github.com/javan/whenever

我确实把它放在了我的 Gemfile

gem 'whenever', :require => false

然后无论何时。

& 我在 config/schedule.rb 中有文件

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

当我运行 -> "whenever" 或 "whenever --update-crontab mycron --set environment=development" 或 "whenever --update-crontab mycron" 时,我得到这个消息 -> "[fail] 找不到文件:配置/计划.rb"

谢谢你。

4

2 回答 2

4

问题是您可能不在 rails 根目录中,因此转到根路径应该可以解决您的问题。

于 2013-03-05T03:13:43.553 回答
2

你可以试试吗?

cd /my_rails_application_root_path && bundle exec whenever

您可以在https://github.com/cwninja/whenever/blob/master/bin/whenever查看二进制源代码

如果不传递属性-f,默认使用config/schedule.rb,但也可以运行

whenever -f COMPLETE_PATH_TO_SCHEDULE_RB
于 2013-03-05T02:51:09.077 回答