1

运行 script/delayed_job start 命令时出现以下错误

NameError: uninitialized constant Delayed::Worker
            load_missing_constant at c:/jruby-1.6.8/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:440
            load_missing_constant at c:/jruby-1.6.8/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:437
  const_missing_with_dependencies at c:/jruby-1.6.8/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80
                        daemonize at c:/jruby-1.6.8/lib/ruby/gems/1.8/gems/delayed_job-2.0.8/lib/delayed/command.rb:58
                           (root) at script/delayed_job:5

script/delayed_job 包含以下代码

#!/usr/bin/env ruby

require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment'))
require 'delayed/command'
Delayed::Command.new(ARGV).daemonize

我正在使用 2.0.8 版本的延迟作业 gem。我当前的 rails 版本是 2.3.5。

请帮我解决这个问题

4

1 回答 1

2

您应该在此处查看2.0.8 版本的 README

如果使用 active_record 做:

script/generate delayed_job
rake db:migrate
于 2013-07-10T14:32:43.737 回答