Created
October 26, 2011 14:08
-
-
Save snatchev/1316470 to your computer and use it in GitHub Desktop.
resque worker devise not eager loading
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❷ > QUEUE=* rake resque:work --trace | |
** Invoke resque:work (first_time) | |
** Invoke resque:preload (first_time) | |
** Invoke resque:setup (first_time) | |
** Execute resque:setup | |
** Execute resque:preload | |
rake aborted! | |
No such file to load -- devise/confirmations_controller | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:306:in `rescue in depend_on' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:301:in `depend_on' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:214:in `require_dependency' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/railties-3.1.1/lib/rails/engine.rb:417:in `block (2 levels) in eager_load!' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/railties-3.1.1/lib/rails/engine.rb:416:in `each' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/railties-3.1.1/lib/rails/engine.rb:416:in `block in eager_load!' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/railties-3.1.1/lib/rails/engine.rb:414:in `each' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/railties-3.1.1/lib/rails/engine.rb:414:in `eager_load!' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/railties-3.1.1/lib/rails/application/railties.rb:8:in `each' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/railties-3.1.1/lib/rails/application/railties.rb:8:in `all' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/railties-3.1.1/lib/rails/engine.rb:412:in `eager_load!' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/resque-1.19.0/lib/resque/tasks.rb:47:in `block (2 levels) in <top (required)>' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/rake-0.9.2/lib/rake/task.rb:205:in `call' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/rake-0.9.2/lib/rake/task.rb:200:in `each' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain' | |
/Users/stefan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/rake-0.9.2/lib/rake/task.rb:176:in `block in invoke_prerequisites' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/rake-0.9.2/lib/rake/task.rb:174:in `each' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/rake-0.9.2/lib/rake/task.rb:174:in `invoke_prerequisites' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/rake-0.9.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain' | |
/Users/stefan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/rake-0.9.2/lib/rake/application.rb:90:in `each' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/rake-0.9.2/lib/rake/application.rb:59:in `run' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/gems/rake-0.9.2/bin/rake:32:in `<top (required)>' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/bin/rake:19:in `load' | |
/Users/stefan/.rvm/gems/ruby-1.9.2-p290@my-rails-project/bin/rake:19:in `<main>' | |
Tasks: TOP => resque:work => resque:preload |
This is an issue if you are adding Resque to a Rails app. As we know Resque does not require Rails. The solution allows you to load the entire Rails environment when you start up the workers. I did not see this issue when demoing Resque on a stand alone Ruby application.
And if you're using foreman, the corresponding syntax in your Procfile, that will also work, is
resque: bundle exec rake environment resque:work
In my case, I used .env to set my QUEUE environment variable:
QUEUE='*'
thank you for this!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Works well. 😄 Thanks a lot.