【发布时间】:2012-03-22 14:11:57
【问题描述】:
我所拥有的 resque 工作不依赖于 Rails 中的任何内容,但我很难在没有 rails env 的情况下开始工作。我看过这篇文章,但没有帮助 (ruby resque without loading rails environment)
这是我当前的 rake 文件:
require "resque/tasks"
task "resque:setup" do
root_path = "#{File.dirname(__FILE__)}/../.."
require "#{root_path}/app/workers/myworker.rb"
end
#task "resque:setup" => :environment
注释的任务将加载 Rails 环境并且一切正常,但这不是我想要的。运行 rake resque:work 时出现此错误:
rake aborted!
No such file to load -- application_controller
Tasks: TOP => resque:work => resque:preload
【问题讨论】:
标签: ruby-on-rails ruby rake resque