开发者

Phusion throws undefined method `Struct' for main:Object with delayed_jobs

So I have a class t开发者_运维知识库hat gets loaded and is supposed to be run by delayed_jobs and to get some parameters into the class I have used the Struct trick, this works on development but not on production running rails 3.0.3 and passenger 3. Any one know why?

The error message Im getting from passenger is "undefined method `Struct' for main:Object" and the code is as follows.

class HandsetReader < Struct.new(:csv_id)
  def perform
    @csv = CsvFiles.find(csv_id)

    if @csv.external_type == "Customer"
      ..
    else
      ..
    end
end


Try require 'struct' as the first line of your source file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜