Question

I'm having an issue with including a file in my worker file... What do I need to do so that the required files are found when queueing a job?

Here's the error:

/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>'

Here's the code:

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

class RealtimeWorker < IronWorker::Base

    attr_accessor :team_list

    def run
Was it helpful?

Solution

You'll want to use the merge functions provided by the iron_worker gem.

There are several like:

  • merge 'file'
  • merge_gem 'some_gem'
  • merge_folder 'directory'

More info here: https://github.com/iron-io/iron_worker_ruby/wiki/Merging

OTHER TIPS

require 'iron_worker'

class RealtimeWorker < IronWorker::Base
  merge 'my_woker_helper.rb'
  merge 'real_time_helper.rb'
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top