我試圖將一個模塊包含到我的resque工作者中但是我一直收到這個錯誤 -Rails Resque - 在worker中包含來自rails lib的模塊
failed: #<NoMethodError: undefined method `build_page' for RefreshEventCache:Class>
工作者 - /app/worker/refresh_event_cache.rb
require File.dirname(__FILE__) + '/../../lib/locomotive/render.rb'
class RefreshEventCache
include Resque::Plugins::UniqueJob
include Locomotive::Render
@queue = :events_queue
def self.perform(url)
build_page(url)
end
end
模塊 -/lib/locomotive/render.rb
module Locomotive
module Render
extend ActiveSupport::Concern
module InstanceMethods
def build_page(full_path)
Rails.logger.debug "BUILDING PAGE"
end
end
end
end
任何想法?
可能重複[Rails在外部模塊Resque undefined方法錯誤](http://stackoverflow.com/questions/8130071/rails-resque-undefined-method-error-in-external-module) – d3vkit