0

Rails アプリケーションで Resque ワーカーがローカルで起動しません。次のコマンドを入力してワーカーを起動します。

COUNT=1 QUEUE=* rake resque:work --trace

そして、次のエラーが発生します。以前はこれが機能していましたが、エラーが表示される原因がわかりません。

(in /home/omar/Github/brooklin)
** Invoke resque:work (first_time)
** Invoke resque:preload (first_time)
** Invoke resque:setup (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute resque:setup
** Execute resque:preload
rake aborted!
No such file to load -- exception
/home/omar/.rvm/gems/ruby-1.9.3-p194@Brooklin/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:317:in `rescue in depend_on'
/home/omar/.rvm/gems/ruby-1.9.3-p194@Brooklin/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:312:in `depend_on'
/home/omar/.rvm/gems/ruby-1.9.3-p194@Brooklin/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:225:in `require_dependency'
/home/omar/.rvm/gems/ruby-1.9.3-p194@Brooklin/gems/railties-3.2.6/lib/rails/engine.rb:439:in `block (2 levels) in eager_load!'
/home/omar/.rvm/gems/ruby-1.9.3-p194@Brooklin/gems/railties-3.2.6/lib/rails/engine.rb:438:in `each'
/home/omar/.rvm/gems/ruby-1.9.3-p194@Brooklin/gems/railties-3.2.6/lib/rails/engine.rb:438:in `block in eager_load!'
/home/omar/.rvm/gems/ruby-1.9.3-p194@Brooklin/gems/railties-3.2.6/lib/rails/engine.rb:436:in `each'
/home/omar/.rvm/gems/ruby-1.9.3-p194@Brooklin/gems/railties-3.2.6/lib/rails/engine.rb:436:in `eager_load!'
/home/omar/.rvm/gems/ruby-1.9.3-p194@Brooklin/gems/resque-1.21.0/lib/resque/tasks.rb:54:in `block (2 levels) in <top (required)>'
/home/omar/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/home/omar/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/home/omar/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/home/omar/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/home/omar/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/home/omar/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/omar/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/omar/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/home/omar/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/home/omar/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/home/omar/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/home/omar/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/omar/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/omar/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/home/omar/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/home/omar/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/home/omar/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/home/omar/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/home/omar/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/omar/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/home/omar/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/home/omar/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/omar/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/home/omar/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/home/omar/.rvm/gems/ruby-1.9.3-p194@global/bin/rake:19:in `load'
/home/omar/.rvm/gems/ruby-1.9.3-p194@global/bin/rake:19:in `<main>'
/home/omar/.rvm/gems/ruby-1.9.3-p194@Brooklin/bin/ruby_noexec_wrapper:14:in `eval'
/home/omar/.rvm/gems/ruby-1.9.3-p194@Brooklin/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => resque:work => resque:preload

同様に、以下は私の lib/tasks/resque.rake ファイルです。

require 'resque/tasks'
require 'resque_scheduler/tasks'

task "resque:setup" => :environment do
    ENV['QUEUE'] = '*'
end

desc "Alias for resque:work (To run workers on Heroku)"
task "jobs:work" => "resque:work"

task "resque:scheduler_setup" => :environment

config/application.rb に以下を追加して、resque.rake ファイルをロード パスに追加しました。

config.autoload_paths += %W(#{config.root}/lib/tasks/)

ご協力いただきありがとうございます。

4

1 に答える 1

0

出力ステートメントは少し誤解を招きます。

No such file to load -- exception

私のモデルの 1 つにあっrequire exceptionたことが判明しましたが、ファイルの例外が見つからなかったため、不平を言っていました。

于 2012-08-14T03:58:07.673 に答える