私はresqueを使い始めたかったのです。その後、私は最初の問題もなく$ルビーcreate_job.rbを実行rake resque:単純な例で作業が失敗する
--- image_transformer.rb --- # coding: UTF-8 class ImageTransformer @queue = 'image_transform_queue' def self.perform(asset_id) puts "perform" puts asset_id end end
--- create_job.rb --- # coding: UTF-8 require 'resque' require_relative 'image_transformer' Resque.enqueue(ImageTransformer, 'test')
--- Rakefile --- # coding: UTF-8 require_relative 'image_transformer' require 'resque/tasks'
:だから私は三つのファイル、ダミージョブを作成するには1、それを処理するために他の二つを作成しました。私はresqueキューでジョブを見ることができます。
今、私は労働者を開始したい - しかし、それは失敗します。
$ QUEUE=* VVERBOSE=1 VERBOSE=1 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 ** Invoke resque:setup ** Execute resque:work *** Starting worker anpr-THINK:15292:* Signals QUIT, USR1, USR2, and/or CONT not supported. *** Registered signals *** Checking content_download *** Checking image_transform_queue *** Found job on image_transform_queue *** got: (Job{image_transform_queue} | ImageTransformer | ["test"]) rake aborted! "\xE4" on US-ASCII c:/ruby193/lib/ruby/gems/1.9.1/gems/multi_json-1.2.0/lib/multi_json/engines/json _common.rb:13:in `encode' c:/ruby193/lib/ruby/gems/1.9.1/gems/multi_json-1.2.0/lib/multi_json/engines/json _common.rb:13:in `to_json' c:/ruby193/lib/ruby/gems/1.9.1/gems/multi_json-1.2.0/lib/multi_json/engines/json _common.rb:13:in `encode' c:/ruby193/lib/ruby/gems/1.9.1/gems/multi_json-1.2.0/lib/multi_json.rb:88:in `en code' c:/ruby193/lib/ruby/gems/1.9.1/gems/resque-1.20.0/lib/resque/helpers.rb:22:in `e ncode' c:/ruby193/lib/ruby/gems/1.9.1/gems/resque-1.20.0/lib/resque/worker.rb:396:in `w orking_on' c:/ruby193/lib/ruby/gems/1.9.1/gems/resque-1.20.0/lib/resque/worker.rb:133:in `b lock in work' c:/ruby193/lib/ruby/gems/1.9.1/gems/resque-1.20.0/lib/resque/worker.rb:126:in `l oop' c:/ruby193/lib/ruby/gems/1.9.1/gems/resque-1.20.0/lib/resque/worker.rb:126:in `w ork' c:/ruby193/lib/ruby/gems/1.9.1/gems/resque-1.20.0/lib/resque/tasks.rb:34:in `blo ck (2 levels) in ' c:/ruby193/lib/ruby/1.9.1/rake/task.rb:205:in `call' c:/ruby193/lib/ruby/1.9.1/rake/task.rb:205:in `block in execute' c:/ruby193/lib/ruby/1.9.1/rake/task.rb:200:in `each' c:/ruby193/lib/ruby/1.9.1/rake/task.rb:200:in `execute' c:/ruby193/lib/ruby/1.9.1/rake/task.rb:158:in `block in invoke_with_call_chain' c:/ruby193/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize' c:/ruby193/lib/ruby/1.9.1/rake/task.rb:151:in `invoke_with_call_chain' c:/ruby193/lib/ruby/1.9.1/rake/task.rb:144:in `invoke' c:/ruby193/lib/ruby/1.9.1/rake/application.rb:116:in `invoke_task' c:/ruby193/lib/ruby/1.9.1/rake/application.rb:94:in `block (2 levels) in top_lev el' c:/ruby193/lib/ruby/1.9.1/rake/application.rb:94:in `each' c:/ruby193/lib/ruby/1.9.1/rake/application.rb:94:in `block in top_level' c:/ruby193/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handlin g' c:/ruby193/lib/ruby/1.9.1/rake/application.rb:88:in `top_level' c:/ruby193/lib/ruby/1.9.1/rake/application.rb:66:in `block in run' c:/ruby193/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handlin g' c:/ruby193/lib/ruby/1.9.1/rake/application.rb:63:in `run' c:/ruby193/bin/rake:32:in `' Tasks: TOP => resque:work
誰かが何が起こっているの手掛かりを持っていますか?それはいくつかのエンコーディングの問題のように見えますが、どこですか?
私はWindows 7を使用しています(該当する場合)。
編集:私は '#encode' メソッドにデバッグ出力を挿入 : {:キュー=> "image_transform_queue":run_at => "2012年3月28日夜一時25分53秒Mitteleurop \ xE4i SCHE Sommerzeit ":run_at"値にはドイツ語のウムラウトが含まれているように見えます(これは私のものです)。ロケール)。未回答のリストを、それを降り
問題を再現し、試すことができる最小限の実行可能なバージョンを作成できますか? –
私はそれが私の考えだと思った。 –
いいですね!これを回答として投稿する必要があります。 –