私はこのようなクラスを持っています
class RecurringJob
include ScheduledJob
run_every 1.hours
def perform
puts "perform job"
end
end
次のようなエラーが発生します。
ScheduledJobを定義するためにD:/ASM/source/app/lib/jobs/scheduled_job.rbが必要です
ファイル定義は次のとおりです。
module Delayed
module ScheduledJob
def self.included(base)
base.extend(ClassMethods)
base.class_eval do
@@logger = Delayed::Worker.logger
cattr_reader :logger
end
end
....
end
end
エラーはどういう意味ですか?それは定義ではありませんか?
編集
私はあなたが知っている必要があります、クラスはrakeタスク内で定義されました(クラスを除いて空であり、それが許可されているかどうかはわかりません)。
より詳細なエラー:
Expected D:/ASM/source/app/lib/jobs/scheduled_job.rb to define ScheduledJob
D:/Software/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:503:in `load_missing_constant'
D:/Software/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:192:in `block in const_missing'
D:/Software/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:190:in `each'
D:/Software/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:190:in `const_missing'
D:/Software/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:514:in `load_missing_constant'
D:/Software/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:192:in `block in const_missing'
D:/Software/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:190:in `each'
D:/Software/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:190:in `const_missing'
D:/ASM/source/app/lib/tasks/sandbox.rake:29:in `<class:RecurringJob>'
D:/ASM/source/app/lib/tasks/sandbox.rake:28:in `block in <top (required)>'