0

resque在 Rails 做。在 Rails 项目中,我有一个文件名setup.rb,并且helper.rb在同一目录中。在setup.rb我有

require './helper'

当我尝试运行bundle exec rake resque:work QUEUE="*"rake resque:work QUEUE="*"出现错误时。错误是:

No such file to load -- ./helper

当我尝试使用 Rails 控制台时,Dir.chdir进入该目录并输入require './helper'它返回 true,这意味着它工作正常。我无法解释为什么setup.rb不能需要'./helper'。

4

1 回答 1

1

尝试使用 Rails.root 作为文件路径并使其成为绝对而不是相对

于 2012-07-27T20:33:41.413 回答