我遇到了一个问题,包括IronWorker上我的工作人员的文件

时间:2012-04-24 19:10:48

标签: ironworker

我遇到了在我的工作文件中包含文件的问题...我需要做什么才能在排队时找到所需的文件?

这是错误:

/usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load -- my_worker_helper (LoadError)
    from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /task/realtime_worker.rb:2:in `<top (required)>'
    from /task/runner.rb:343:in `require_relative'
    from /task/runner.rb:343:in `<main>'

以下是代码:

require 'iron_worker'
require 'my_worker_helper'
require 'real_time_helper'

class RealtimeWorker < IronWorker::Base

    attr_accessor :team_list

    def run

2 个答案:

答案 0 :(得分:2)

require 'iron_worker'

class RealtimeWorker < IronWorker::Base
  merge 'my_woker_helper.rb'
  merge 'real_time_helper.rb'

答案 1 :(得分:2)

您需要使用merge gem提供的iron_worker函数。

有几个像:

  • 合并'档'
  • merge_gem'some_gem'
  • merge_folder'目录'

此处有更多信息:https://github.com/iron-io/iron_worker_ruby/wiki/Merging