2012-03-12 8 views
1

次の問題が発生しています。 ActionMailerのテンプレートをレンダリングしようとすると、My Resqueのバックグラウンドジョブが失敗します。しかし、これは私がプロダクション環境にいるときにのみ起こります。Rails ActionMailerが本番環境でルーティングエラーを発生させる理由を教えてください。

エラーはルーティングエラーと関係があります。ここでは、スタックトレースは次のように私のビューテンプレートで

/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionpack-3.0.11/lib/action_dispatch/routing/route_set.rb:425:in `raise_routing_error' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionpack-3.0.11/lib/action_dispatch/routing/route_set.rb:407:in `rescue in generate' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionpack-3.0.11/lib/action_dispatch/routing/route_set.rb:396:in `generate' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionpack-3.0.11/lib/action_dispatch/routing/route_set.rb:454:in `generate' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionpack-3.0.11/lib/action_dispatch/routing/route_set.rb:482:in `url_for' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionpack-3.0.11/lib/action_dispatch/routing/url_for.rb:131:in `url_for' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionpack-3.0.11/lib/action_view/helpers/url_helper.rb:99:in `url_for' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionpack-3.0.11/lib/action_dispatch/routing/route_set.rb:195:in `account_case_url' 
/home/foo/production/source/app/views/case_mailer/case_creation.html.erb:3:in `_app_views_case_mailer_case_creation_html_erb__56964564007999368_36702160_384137435874551441' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionpack-3.0.11/lib/action_view/template.rb:162:in `block in render' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.11/lib/active_support/notifications.rb:54:in `instrument' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionpack-3.0.11/lib/action_view/template.rb:154:in `render' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionpack-3.0.11/lib/action_view/render/rendering.rb:59:in `block in _render_template' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.11/lib/active_support/notifications.rb:52:in `block in instrument' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.11/lib/active_support/notifications/instrumenter.rb:21:in `instrument' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.11/lib/active_support/notifications.rb:52:in `instrument' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionpack-3.0.11/lib/action_view/render/rendering.rb:56:in `_render_template' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionpack-3.0.11/lib/action_view/render/rendering.rb:26:in `render' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionpack-3.0.11/lib/abstract_controller/rendering.rb:115:in `_render_template' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionpack-3.0.11/lib/abstract_controller/rendering.rb:109:in `render_to_body' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionpack-3.0.11/lib/abstract_controller/rendering.rb:102:in `render_to_string' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionpack-3.0.11/lib/abstract_controller/rendering.rb:93:in `render' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.0.11/lib/action_mailer/deprecated_api.rb:111:in `render' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.0.11/lib/action_mailer/base.rb:735:in `block in collect_responses_and_parts_order' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.0.11/lib/action_mailer/base.rb:750:in `each' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.0.11/lib/action_mailer/base.rb:750:in `block in each_template' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.0.11/lib/action_mailer/base.rb:745:in `each' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.0.11/lib/action_mailer/base.rb:745:in `each_template' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.0.11/lib/action_mailer/base.rb:731:in `collect_responses_and_parts_order' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.0.11/lib/action_mailer/base.rb:673:in `mail' 
/home/foo/production/source/app/mailers/case_mailer.rb:13:in `case_creation' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionpack-3.0.11/lib/abstract_controller/base.rb:150:in `process_action' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionpack-3.0.11/lib/abstract_controller/base.rb:119:in `process' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionpack-3.0.11/lib/abstract_controller/rendering.rb:41:in `process' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.0.11/lib/action_mailer/old_api.rb:75:in `process' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.0.11/lib/action_mailer/base.rb:471:in `process' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.0.11/lib/action_mailer/base.rb:466:in `initialize' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/resque_mailer-1.0.1/lib/resque_mailer/rails3.rb:16:in `new' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/resque_mailer-1.0.1/lib/resque_mailer/rails3.rb:16:in `deliver!' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/resque_mailer-1.0.1/lib/resque_mailer/rails3.rb:37:in `perform' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/resque-1.17.1/lib/resque/job.rb:127:in `perform' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/resque-1.17.1/lib/resque/worker.rb:163:in `perform' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/resque-1.17.1/lib/resque/worker.rb:130:in `block in work' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/resque-1.17.1/lib/resque/worker.rb:116:in `loop' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/resque-1.17.1/lib/resque/worker.rb:116:in `work' 
script/resque_worker:13:in `start' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/daemon-spawn-0.4.2/lib/daemon_spawn.rb:51:in `block in start' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/daemon-spawn-0.4.2/lib/daemon_spawn.rb:38:in `fork' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/daemon-spawn-0.4.2/lib/daemon_spawn.rb:38:in `start' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/daemon-spawn-0.4.2/lib/daemon_spawn.rb:181:in `block in start' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/daemon-spawn-0.4.2/lib/daemon_spawn.rb:181:in `map' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/daemon-spawn-0.4.2/lib/daemon_spawn.rb:181:in `start' 
/home/foo/production/source/vendor/bundle/ruby/1.9.1/gems/daemon-spawn-0.4.2/lib/daemon_spawn.rb:165:in `spawn!' 
script/resque_worker:22:in `<main>' 

コードがあります

link_to _("Click here to see the case"), 
     account_case_url(:only_path => false, 
         :host => "production.foo.com", 
         :controller => "cases", 
         :action => "show", 
         :id => @case.id, :account_id => @case.account.id) 

私は答えが与えられていない、similar post on SOがあることを知っているが。また、私の問題は本番環境だけに現れていると言わざるを得ない。

更新日私はこれが再調整には関係しないと再度言わなければなりません。私はresqueメーラーを無効にした後で問題を再現することができます。したがって、この問題の原因となるのは、生産上のActionMailerです。

UPDATE 2問題はRails 3.0.11および3.0.12にあるようです。 3.0.10はうまく動作します。

+0

これはスタックトレースですが、その実際のエラーメッセージは何ですか? –

+0

@AndrewMarshall 'ActionView :: Template :: Error' –

答えて

0

Rails 3.0.10にロールバックします。バグは3.0.11と3.0.12にあります。

+0

と3.0.14と思います –

関連する問題