Note that there are some explanatory texts on larger screens.

plurals
  1. POactionmailer delayed job error
    text
    copied!<p>i have a strange bug using mailer and delayed job with rails 3 and ruby 1.9.2.</p> <p>I have a method in my mailer </p> <pre><code>def new_site_message(sitereq) @footer = Textvar.where(:title =&gt; "email_footer").first @sitereq = Sitereq.first mail(:to =&gt; EmailGroup.where(:name =&gt; "new_sitemessage_group").first.emails.map(&amp;:email).join(", "), :subject =&gt; "Test") end </code></pre> <p>It works good while undelayed with delayed job. But when i delay it - i get error (from delayed_jobs table, last_error):</p> <pre><code>{undefined method `ascii_only?' for #&lt;Email:0xa67780c&gt; /opt/ruby/lib/ruby/gems/1.9.1/gems/activemodel-3.0.4/lib/active_model/attribute_methods.rb:364:in `method_missing' /opt/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.4/lib/active_record/attribute_methods.rb:46:in `method_missing' /opt/ruby/lib/ruby/gems/1.9.1/gems/mail-2.2.15/lib/mail/encodings.rb:181:in `encode_non_usascii' /opt/ruby/lib/ruby/gems/1.9.1/gems/mail-2.2.15/lib/mail/encodings.rb:176:in `address_encode' /opt/ruby/lib/ruby/gems/1.9.1/gems/mail-2.2.15/lib/mail/encodings.rb:173:in `block in address_encode' /opt/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.4/lib/active_record/associations/association_collection.rb:430:in `block in method_missing' /opt/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.4/lib/active_record/associations/association_proxy.rb:216:in `block in method_missing' /opt/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.4/lib/active_record/associations/association_proxy.rb:216:in `map' /opt/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.4/lib/active_record/associations/association_proxy.rb:216:in `method_missing' /opt/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.4/lib/active_record/associations/association_collection.rb:430:in `method_missing' /opt/ruby/lib/ruby/gems/1.9.1/gems/mail-2.2.15/lib/mail/encodings.rb:173:in `address_encode' /opt/ruby/lib/ruby/gems/1.9.1/gems/mail-2.2.15/lib/mail/fields/common/common_address.rb:20:in `encode_if_needed' /opt/ruby/lib/ruby/gems/1.9.1/gems/mail-2.2.15/lib/mail/fields/common/common_address.rb:9:in `parse' /opt/ruby/lib/ruby/gems/1.9.1/gems/mail-2.2.15/lib/mail/fields/to_field.rb:42:in `initialize' /opt/ruby/lib/ruby/gems/1.9.1/gems/mail-2.2.15/lib/mail/field.rb:158:in `new' /opt/ruby/lib/ruby/gems/1.9.1/gems/mail-2.2.15/lib/mail/field.rb:158:in `new_field' /opt/ruby/lib/ruby/gems/1.9.1/gems/mail-2.2.15/lib/mail/field.rb:145:in `create_field' /opt/ruby/lib/ruby/gems/1.9.1/gems/mail-2.2.15/lib/mail/field.rb:78:in `initialize' /opt/ruby/lib/ruby/gems/1.9.1/gems/mail-2.2.15/lib/mail/header.rb:159:in `new' /opt/ruby/lib/ruby/gems/1.9.1/gems/mail-2.2.15/lib/mail/header.rb:159:in `[]=' /opt/ruby/lib/ruby/gems/1.9.1/gems/mail-2.2.15/lib/mail/message.rb:1222:in `[]=' /opt/ruby/lib/ruby/gems/1.9.1/gems/actionmailer-3.0.4/lib/action_mailer/base.rb:647:in `block in mail' /opt/ruby/lib/ruby/gems/1.9.1/gems/actionmailer-3.0.4/lib/action_mailer/base.rb:647:in `each' /opt/ruby/lib/ruby/gems/1.9.1/gems/actionmailer-3.0.4/lib/action_mailer/base.rb:647:in `mail' /projects/smartspace/app/mailers/notice_mailer.rb:68:in `new_site_message' /opt/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.0.4/lib/abstract_controller/base.rb:150:in `process_action' /opt/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.0.4/lib/abstract_controller/base.rb:119:in `process' /opt/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.0.4/lib/abstract_controller/rendering.rb:41:in `process' /opt/ruby/lib/ruby/gems/1.9.1/gems/actionmailer-3.0.4/lib/action_mailer/old_api.rb:75:in `process' /opt/ruby/lib/ruby/gems/1.9.1/gems/actionmailer-3.0.4/lib/action_mailer/base.rb:448:in `process' /opt/ruby/lib/ruby/gems/1.9.1/gems/actionmailer-3.0.4/lib/action_mailer/base.rb:443:in `initialize' /opt/ruby/lib/ruby/gems/1.9.1/gems/actionmailer-3.0.4/lib/action_mailer/base.rb:427:in `new' /opt/ruby/lib/ruby/gems/1.9.1/gems/actionmailer-3.0.4/lib/action_mailer/base.rb:427:in `method_missing' /opt/ruby/lib/ruby/gems/1.9.1/gems/delayed_job-2.1.3/lib/delayed/performable_mailer.rb:6:in `perform' /opt/ruby/lib/ruby/gems/1.9.1/gems/delayed_job-2.1.3/lib/delayed/backend/base.rb:87:in `invoke_job' /opt/ruby/lib/ruby/gems/1.9.1/gems/delayed_job-2.1.3/lib/delayed/worker.rb:120:in `block (2 levels) in run' /opt/ruby/lib/ruby/1.9.1/timeout.rb:57:in `timeout' /opt/ruby/lib/ruby/gems/1.9.1/gems/delayed_job-2.1.3/lib/delayed/worker.rb:120:in `block in run' /opt/ruby/lib/ruby/1.9.1/benchmark.rb:309:in `realtime' /opt/ruby/lib/ruby/gems/1.9.1/gems/delayed_job-2.1.3/lib/delayed/worker.rb:119:in `run' /opt/ruby/lib/ruby/gems/1.9.1/gems/delayed_job-2.1.3/lib/delayed/worker.rb:177:in `reserve_and_run_one_job' /opt/ruby/lib/ruby/gems/1.9.1/gems/delayed_job-2.1.3/lib/delayed/worker.rb:104:in `block in work_off' /opt/ruby/lib/ruby/gems/1.9.1/gems/delayed_job-2.1.3/lib/delayed/worker.rb:103:in `times' /opt/ruby/lib/ruby/gems/1.9.1/gems/delayed_job-2.1.3/lib/delayed/worker.rb:103:in `work_off' /opt/ruby/lib/ruby/gems/1.9.1/gems/delayed_job-2.1.3/lib/delayed/worker.rb:78:in `block (2 levels) in start' /opt/ruby/lib/ruby/1.9.1/benchmark.rb:309:in `realtime' /opt/ruby/lib/ruby/gems/1.9.1/gems/delayed_job-2.1.3/lib/delayed/worker.rb:77:in `block in start' /opt/ruby/lib/ruby/gems/1.9.1/gems/delayed_job-2.1.3/lib/delayed/worker.rb:74:in `loop' /opt/ruby/lib/ruby/gems/1.9.1/gems/delayed_job-2.1.3/lib/delayed/worker.rb:74:in `start' /opt/ruby/lib/ruby/gems/1.9.1/gems/delayed_job-2.1.3/lib/delayed/command.rb:100:in `run' /opt/ruby/lib/ruby/gems/1.9.1/gems/delayed_job-2.1.3/lib/delayed/command.rb:79:in `block in run_process' /opt/ruby/lib/ruby/gems/1.9.1/gems/daemons-1.1.0/lib/daemons/application.rb:250:in `call' /opt/ruby/lib/ruby/gems/1.9.1/gems/daemons-1.1.0/lib/daemons/application.rb:250:in `block in start_proc' /opt/ruby/lib/ruby/gems/1.9.1/gems/daemons-1.1.0/lib/daemons/daemonize.rb:199:in `call' /opt/ruby/lib/ruby/gems/1.9.1/gems/daemons-1.1.0/lib/daemons/daemonize.rb:199:in `call_as_daemon' /opt/ruby/lib/ruby/gems/1.9.1/gems/daemons-1.1.0/lib/daemons/application.rb:254:in `start_proc' /opt/ruby/lib/ruby/gems/1.9.1/gems/daemons-1.1.0/lib/daemons/application.rb:294:in `start' /opt/ruby/lib/ruby/gems/1.9.1/gems/daemons-1.1.0/lib/daemons/controller.rb:70:in `run' /opt/ruby/lib/ruby/gems/1.9.1/gems/daemons-1.1.0/lib/daemons.rb:193:in `block in run_proc' /opt/ruby/lib/ruby/gems/1.9.1/gems/daemons-1.1.0/lib/daemons/cmdline.rb:112:in `call' /opt/ruby/lib/ruby/gems/1.9.1/gems/daemons-1.1.0/lib/daemons/cmdline.rb:112:in `catch_exceptions' /opt/ruby/lib/ruby/gems/1.9.1/gems/daemons-1.1.0/lib/daemons.rb:192:in `run_proc' /opt/ruby/lib/ruby/gems/1.9.1/gems/delayed_job-2.1.3/lib/delayed/command.rb:78:in `run_process' /opt/ruby/lib/ruby/gems/1.9.1/gems/delayed_job-2.1.3/lib/delayed/command.rb:72:in `block in daemonize' /opt/ruby/lib/ruby/gems/1.9.1/gems/delayed_job-2.1.3/lib/delayed/command.rb:70:in `times' /opt/ruby/lib/ruby/gems/1.9.1/gems/delayed_job-2.1.3/lib/delayed/command.rb:70:in `daemonize' script/delayed_job:5:in `&lt;main&gt;' </code></pre> <p>Other mailer methods works fine with delayed jobs, and only this one gets error. I tried to change :to to simle string email, but ring no bells. </p> <p>What should i do to correct this error?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload