iron_worker_ruby_ng icon indicating copy to clipboard operation
iron_worker_ruby_ng copied to clipboard

Running workers locally fails with LoadError on required gems

Open sfcgeorge opened this issue 13 years ago • 1 comments

I'm using ruby 1.9.3 with latest bundler and iron_worker_ng.

I download the examples and cd into worker101, then successfully run the iron_worker install worker101 command, but then it fails on the iron_worker run worker101 command. It looks like the gems are being merged, but the require is unable to find them (locally, I'd like to get it running locally before pushing to IronWorker in the cloud).


Simons-RMBP:worker101 Simon$ iron_worker install worker101
------> Installing dependencies for code package with name='worker101'
        Found workerfile with path='worker101.worker'
        Detected exec with path='worker101.rb' and args='{}'
        Adding ruby gem dependency with name='twitter' and version='>= 0'
Fetching gem metadata from http://rubygems.org/...........
Fetching gem metadata from http://rubygems.org/..
Installing multipart-post (1.1.5) 
Installing faraday (0.8.4) 
Using multi_json (1.5.0) 
Installing simple_oauth (0.2.0) 
Installing twitter (4.4.2) 
Using bundler (1.2.3) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
Simons-RMBP:worker101 Simon$ iron_worker run worker101
------> Creating code package
        Found workerfile with path='worker101.worker'
        Detected exec with path='worker101.rb' and args='{}'
        Adding ruby gem dependency with name='twitter' and version='>= 0'
        Code package name is 'RubyWorker101'
------> Running 'RubyWorker101'
        Fixating gems dependencies
        Merging ruby gem with name='multipart-post' and version='1.1.5'
        Merging ruby gem with name='faraday' and version='0.8.4'
        Merging ruby gem with name='multi_json' and version='1.5.0'
        Merging ruby gem with name='simple_oauth' and version='0.2.0'
        Merging ruby gem with name='twitter' and version='4.4.2'
/Users/Simon/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- twitter (LoadError)
        from /Users/Simon/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /var/folders/rt/vlrg8_6d22dcv3gc2vhzgzkc0000gn/T/iron-worker-ng-20121226-4835-snkuaz-container/worker101.rb:1:in `<top (required)>'
        from /Users/Simon/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /Users/Simon/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from __runner__.rb:190:in `<main>'

Another worker I'm working on has the same problem. I'm guessing it's a problem with my environment, there always seems to be something wrong with path, could that be it? I usually end up spending hours pasting stuff into .bashrc, or --force something, or rm -rf / :wink:

Edit: And I had to rewrite this description as Github managed to delete it all, clearly not having a lucky code day. Very tempted to install a keylogger on myself to prevent swathes of text getting lost. Edit 2: Third time lucky. This time I copied what I'd written before saving as, yes, Github lost it all again. Grr

sfcgeorge avatar Dec 26 '12 15:12 sfcgeorge

It would be really nice if I could actually use IronWorker. Updated the gem, tried again, no change. Any ideas?

sfcgeorge avatar Feb 11 '13 02:02 sfcgeorge