Good afternoon,
I have an app running on Heroku with an identical staging application. Everything should be exactly the same between the two, except that I've copied over the environment/production.rb to environment/staging.rb.
I have changed the environment variables as well:
RACK_ENV=staging
RAILS_ENV=staging
E-mail will send exactly as expected on my production app, but when I go to send one in my staging app, it fails miserably:
!ruby/ActiveRecord:Delayed::Backend::ActiveRecord::Job
attributes:
id: 6
priority: 0
attempts: 2
handler: |
--- !ruby/object:Delayed::PerformableMailer
args:
- 3
method_name: :admin_notification_signup
object: !ruby/class UserMailer
last_error: |-
{undefined method `index' for :email:Symbol
/app/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/encodings.rb:117:in `value_decode'
/app/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/encodings.rb:101:in `decode_encode'
/app/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/fields/unstructured_field.rb:64:in `do_decode'
/app/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/fields/unstructured_field.rb:46:in `decoded'
/app/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/fields/unstructured_field.rb:115:in `fold'
/app/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/fields/unstructured_field.rb:96:in `wrapped_value'
/app/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/fields/unstructured_field.rb:60:in `do_encode'
/app/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/fields/unstructured_field.rb:42:in `encoded'
/app/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/field.rb:133:in `method_missing'
/app/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/header.rb:190:in `block in encoded'
/app/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/header.rb:189:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/header.rb:189:in `encoded'
/app/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/message.rb:1708:in `encoded'
/app/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.3/lib/action_mailer/base.rb:433:in `set_payload_for_mail'
/app/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.3/lib/action_mailer/base.rb:413:in `block in deliver_mail'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/notifications.rb:123:in `block in instrument'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/notifications.rb:123:in `instrument'
/app/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.3/lib/action_mailer/base.rb:412:in `deliver_mail'
/app/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/message.rb:229:in `deliver'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/performable_mailer.rb:6:in `perform'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/backend/base.rb:94:in `block in invoke_job'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:60:in `call'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:60:in `block in initialize'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:65:in `call'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:65:in `execute'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:38:in `run_callbacks'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/backend/base.rb:91:in `invoke_job'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/worker.rb:178:in `block (2 levels) in run'
/app/vendor/ruby-1.9.3/lib/ruby/1.9.1/timeout.rb:68:in `timeout'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/worker.rb:178:in `block in run'
/app/vendor/ruby-1.9.3/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/worker.rb:177:in `run'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/worker.rb:234:in `block in reserve_and_run_one_job'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:60:in `call'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:60:in `block in initialize'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:65:in `call'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:65:in `execute'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:38:in `run_callbacks'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/worker.rb:234:in `reserve_and_run_one_job'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/worker.rb:162:in `block in work_off'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/worker.rb:161:in `times'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/worker.rb:161:in `work_off'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/worker.rb:133:in `block (4 levels) in start'
/app/vendor/ruby-1.9.3/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/worker.rb:132:in `block (3 levels) in start'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:60:in `call'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:60:in `block in initialize'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:65:in `call'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:65:in `execute'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:38:in `run_callbacks'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/worker.rb:129:in `block (2 levels) in start'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/worker.rb:128:in `loop'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/worker.rb:128:in `block in start'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/plugins/clear_locks.rb:7:in `call'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/plugins/clear_locks.rb:7:in `block (2 levels) in <class:ClearLocks>'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:78:in `call'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:78:in `block (2 levels) in add'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:60:in `call'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:60:in `block in initialize'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:78:in `call'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:78:in `block in add'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:65:in `call'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:65:in `execute'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/lifecycle.rb:38:in `run_callbacks'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/worker.rb:127:in `start'
/app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.2/lib/delayed/tasks.rb:9:in `block (2 levels) in <top (required)>'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/app/vendor/ruby-1.9.3/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/app/vendor/bundle/ruby/1.9.1/bin/rake:23:in `load'
/app/vendor/bundle/ruby/1.9.1/bin/rake:23:in `<main>'
run_at: 2012-06-02 20:49:55.976158 Z
locked_at:
failed_at:
locked_by:
queue:
created_at: 2012-06-02 20:49:31.768212 Z
updated_at: 2012-06-02 20:49:34.977784 Z
Does anyone know what could be causing this? I'm using the Roadie gem to pre-style my mail.
user_mailer.rb:
class UserMailer < ActionMailer::Base
default :css => :email, from: "Admin <admin@mysite.com>"
host = ENV['HOST'].gsub(/http:\/\//, "")
default_url_options[:host] = host
......
config:
config.action_mailer.delivery_method = :smtp
config.action_mailer.default :charset => "utf-8"
config.action_mailer.smtp_settings = {
:address => "smtp.gmail.com",
:port => "587",
:domain => "gmail.com",
:user_name => ENV['EMAIL_USER'],
:password => ENV['EMAIL_PASS'],
:authentication => "plain",
:enable_starttls_auto => true
}
As a data point, I got this same error when I had:
default :css => :email
in my development mailer when I didn't have roadie installed. So you might double-check that the gems that you have in both environments are correct.
For the error we got, I think basically the mailing portion of Rails sees the :css => :email
portion and says "I don't know what this symbol means." Normally roadie intercepts this or transforms it somehow, but when I didn't have it installed, it didn't strip it out of the params, so it got all the way to the mailer.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.