badge_label_helper.rb is failing to load in resque jobs

180 Views Asked by At

We are trying to upgrade rails from 4.2 to 5.1.4 along with resque gem. But we got below results on the same.

File : /lib/tasks/resque.rake require 'resque/tasks' require 'resque-scheduler' require 'resque/scheduler/server' require 'resque/scheduler/tasks' task "resque:setup" => :environment do ENV['QUEUE'] = '*' ENV['COUNT'] = '5' require 'resque' require 'resque-scheduler' end

*Error: rake aborted!
LoadError: No such file to load -- badge_label_helper.rb*

_Trace : QUEUE= rake environment resque:work --trace ** Invoke environment (first_time) ** Execute environment ** Invoke resque:work (first_time) ** Invoke resque:preload (first_time) ** Invoke resque:setup (first_time) ** Invoke environment ** Execute resque:setup ** Execute resque:preload rake aborted! LoadError: No such file to load -- badge_label_helper.rb /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:476:in load' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:476:inblock in load_file' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:661:in new_constants_in' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:475:inload_file' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:374:in block in require_or_load' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:36:inblock in load_interlock' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies/interlock.rb:12:in block in loading' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/concurrency/share_lock.rb:149:inexclusive' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies/interlock.rb:11:in loading' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:36:inload_interlock' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:357:in require_or_load' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:335:independ_on' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:251:in require_dependency' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/railties-5.1.4/lib/rails/engine.rb:476:inblock (2 levels) in eager_load!' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/railties-5.1.4/lib/rails/engine.rb:475:in each' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/railties-5.1.4/lib/rails/engine.rb:475:inblock in eager_load!' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/railties-5.1.4/lib/rails/engine.rb:473:in each' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/railties-5.1.4/lib/rails/engine.rb:473:ineager_load!' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/railties-5.1.4/lib/rails/engine.rb:354:in eager_load!' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/resque-1.27.4/lib/resque/tasks.rb:45:ineach' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/resque-1.27.4/lib/resque/tasks.rb:45:in block (2 levels) in <top (required)>' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/rake-12.1.0/lib/rake/task.rb:251:inblock in execute' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/rake-12.1.0/lib/rake/task.rb:251:in each' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/rake-12.1.0/lib/rake/task.rb:251:inexecute' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/rake-12.1.0/lib/rake/task.rb:195:in block in invoke_with_call_chain' /Users/dinilv/.rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/monitor.rb:214:inmon_synchronize' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/rake-12.1.0/lib/rake/task.rb:188:in invoke_with_call_chain' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/rake-12.1.0/lib/rake/task.rb:217:inblock in invoke_prerequisites' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/rake-12.1.0/lib/rake/task.rb:215:in each' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/rake-12.1.0/lib/rake/task.rb:215:ininvoke_prerequisites' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/rake-12.1.0/lib/rake/task.rb:194:in block in invoke_with_call_chain' /Users/dinilv/.rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/monitor.rb:214:inmon_synchronize' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/rake-12.1.0/lib/rake/task.rb:188:in invoke_with_call_chain' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/rake-12.1.0/lib/rake/task.rb:181:ininvoke' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/rake-12.1.0/lib/rake/application.rb:153:in invoke_task' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/rake-12.1.0/lib/rake/application.rb:109:inblock (2 levels) in top_level' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/rake-12.1.0/lib/rake/application.rb:109:in each' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/rake-12.1.0/lib/rake/application.rb:109:inblock in top_level' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/rake-12.1.0/lib/rake/application.rb:118:in run_with_threads' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/rake-12.1.0/lib/rake/application.rb:103:intop_level' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/rake-12.1.0/lib/rake/application.rb:81:in block in run' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/rake-12.1.0/lib/rake/application.rb:179:instandard_exception_handling' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/rake-12.1.0/lib/rake/application.rb:78:in run' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/rake-12.1.0/exe/rake:27:in' /Users/dinilv/.rvm/gems/ruby-2.4.2/bin/rake:23:in load' /Users/dinilv/.rvm/gems/ruby-2.4.2/bin/rake:23:in' /Users/dinilv/.rvm/gems/ruby-2.4.2/bin/ruby_executable_hooks:15:in eval' /Users/dinilv/.rvm/gems/ruby-2.4.2/bin/ruby_executable_hooks:15:in' Tasks: TOP => resque:work => resque:preload_ Command :QUEUE=* rake environment resque:work " _rake aborted! LoadError: No such file to load -- badge_label_helper.rb /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:476:in load' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:476:inblock in load_file' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:661:in new_constants_in' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:475:inload_file' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:374:in block in require_or_load' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:36:inblock in load_interlock' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies/interlock.rb:12:in block in loading' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/concurrency/share_lock.rb:149:inexclusive' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies/interlock.rb:11:in loading' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:36:inload_interlock' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:357:in require_or_load' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:335:independ_on' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:251:in require_dependency' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/railties-5.1.4/lib/rails/engine.rb:476:inblock (2 levels) in eager_load!' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/railties-5.1.4/lib/rails/engine.rb:475:in each' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/railties-5.1.4/lib/rails/engine.rb:475:inblock in eager_load!' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/railties-5.1.4/lib/rails/engine.rb:473:in each' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/railties-5.1.4/lib/rails/engine.rb:473:ineager_load!' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/railties-5.1.4/lib/rails/engine.rb:354:in eager_load!' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/resque-1.27.4/lib/resque/tasks.rb:45:ineach' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/resque-1.27.4/lib/resque/tasks.rb:45:in block (2 levels) in <top (required)>' /Users/dinilv/.rvm/gems/ruby-2.4.2/gems/rake-12.1.0/exe/rake:27:in' /Users/dinilv/.rvm/gems/ruby-2.4.2/bin/ruby_executable_hooks:15:in eval' /Users/dinilv/.rvm/gems/ruby-2.4.2/bin/ruby_executable_hooks:15:in' Tasks: TOP => resque:work => resque:preload (See full trace by running task with --trace)_ "*

1

There are 1 best solutions below

1
On

I encountered exactly the same strange issue. It was working before, but when I reorganised my Gemfile it broke. After a lot of trying I found the solution: The resque-web may not be put into a group. Before:

group :production do
  gem 'resque-web', require: 'resque_web' # This will break
  gem 'resque-pool'
end

After:

gem 'resque-web', require: 'resque_web' # Now it works
group :production do
  gem 'resque-pool'
end

Hope i could help.