【问题标题】:Trying to get SMTP mail server working for devise confirmable in rails app on heroku试图让 SMTP 邮件服务器工作,以便在 heroku 上的 rails 应用程序中确认设计
【发布时间】:2018-09-14 17:48:22
【问题描述】:

我最近部署到 Heroku,一切似乎都正常。但是,当我尝试与新的设计用户注册时,可确认模块会导致我的应用程序崩溃。很可能是我设置操作邮件程序和 SMTP 服务器的方式。

我将在下面发布我的代码。

production.rb:

config.action_mailer.raise_delivery_errors = true
config.action_mailer.default_url_options = { :host => 'boiling-chamber-89366.herokuapp.com' }
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.smtp_settings = {
  :address => "smtp.gmail.com",
  :port => 587,
  :domain => "gmail.com",
  :user_name => ENV["GMAIL_USERNAME"],
  :password => ENV["GMAIL_PASSWORD"],
  :authentication => :plain,
  :enable_starttls_auto => true
}

devise.rb:

config.confirmation_keys = [:email]

我的users 表在schema.rb 中的样子:

create_table "users", force: :cascade do |t|
    t.string "email", default: "", null: false
    t.string "encrypted_password", default: "", null: false
    t.string "reset_password_token"
    t.datetime "reset_password_sent_at"
    t.datetime "remember_created_at"
    t.integer "sign_in_count", default: 0, null: false
    t.datetime "current_sign_in_at"
    t.datetime "last_sign_in_at"
    t.string "current_sign_in_ip"
    t.string "last_sign_in_ip"
    t.string "confirmation_token"
    t.datetime "confirmed_at"
    t.datetime "confirmation_sent_at"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.boolean "admin", default: false
    t.index ["email"], name: "index_users_on_email", unique: true
    t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
  end

Heroku 日志:

2018-09-14T17:43:33.445505+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionmailer-5.2.1/lib/action_mailer/base.rb:560:in `block in deliver_mail'
2018-09-14T17:43:33.445503+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/mail-2.7.0/lib/mail/message.rb:260:in `block in deliver'
2018-09-14T17:43:33.445508+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
2018-09-14T17:43:33.445510+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/notifications.rb:168:in `instrument'
2018-09-14T17:43:33.445512+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionmailer-5.2.1/lib/action_mailer/base.rb:558:in `deliver_mail'
2018-09-14T17:43:33.445522+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionmailer-5.2.1/lib/action_mailer/message_delivery.rb:114:in `block in deliver_now'
2018-09-14T17:43:33.445514+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/mail-2.7.0/lib/mail/message.rb:260:in `deliver'
2018-09-14T17:43:33.445524+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionmailer-5.2.1/lib/action_mailer/rescuable.rb:17:in `handle_exceptions'
2018-09-14T17:43:33.445525+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionmailer-5.2.1/lib/action_mailer/message_delivery.rb:113:in `deliver_now'
2018-09-14T17:43:33.445529+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/devise-4.5.0/lib/devise/models/confirmable.rb:121:in `send_confirmation_instructions'
2018-09-14T17:43:33.445531+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/devise-4.5.0/lib/devise/models/confirmable.rb:183:in `send_on_create_confirmation_instructions'
2018-09-14T17:43:33.445532+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:426:in `block in make_lambda'
2018-09-14T17:43:33.445506+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/notifications.rb:168:in `block in instrument'
2018-09-14T17:43:33.445527+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/devise-4.5.0/lib/devise/models/authenticatable.rb:200:in `send_devise_notification'
2018-09-14T17:43:33.445538+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:517:in `each'
2018-09-14T17:43:33.445534+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:261:in `block in conditional'
2018-09-14T17:43:33.445539+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:517:in `invoke_after'
2018-09-14T17:43:33.445541+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:133:in `run_callbacks'
2018-09-14T17:43:33.445536+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:517:in `block in invoke_after'
2018-09-14T17:43:33.445547+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:816:in `_run_commit_callbacks'
2018-09-14T17:43:33.445551+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:128:in `commit_records'
2018-09-14T17:43:33.445555+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:223:in `block in commit_transaction'
2018-09-14T17:43:33.445549+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.1/lib/active_record/transactions.rb:346:in `committed!'
2018-09-14T17:43:33.445558+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:213:in `commit_transaction'
2018-09-14T17:43:33.445556+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/ruby-2.3.5/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
2018-09-14T17:43:33.445560+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:252:in `block in within_new_transaction'
2018-09-14T17:43:33.445562+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/ruby-2.3.5/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
2018-09-14T17:43:33.445564+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:236:in `within_new_transaction'
2018-09-14T17:43:33.445569+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.1/lib/active_record/transactions.rb:385:in `with_transaction_returning_status'
2018-09-14T17:43:33.445567+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.1/lib/active_record/transactions.rb:212:in `transaction'
2018-09-14T17:43:33.445565+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:254:in `transaction'
2018-09-14T17:43:33.445571+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.1/lib/active_record/transactions.rb:310:in `block in save'
2018-09-14T17:43:33.445573+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.1/lib/active_record/transactions.rb:325:in `rollback_active_record_state!'
2018-09-14T17:43:33.445574+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.1/lib/active_record/transactions.rb:309:in `save'
2018-09-14T17:43:33.445579+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.1/lib/active_record/suppressor.rb:44:in `save'
2018-09-14T17:43:33.445581+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/devise-4.5.0/app/controllers/devise/registrations_controller.rb:19:in `create'
2018-09-14T17:43:33.445582+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
2018-09-14T17:43:33.445586+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/action_controller/metal/rendering.rb:30:in `process_action'
2018-09-14T17:43:33.445584+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/abstract_controller/base.rb:194:in `process_action'
2018-09-14T17:43:33.445587+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
2018-09-14T17:43:33.445591+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/abstract_controller/callbacks.rb:41:in `process_action'
2018-09-14T17:43:33.445589+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:132:in `run_callbacks'
2018-09-14T17:43:33.445595+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
2018-09-14T17:43:33.445593+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/action_controller/metal/rescue.rb:22:in `process_action'
2018-09-14T17:43:33.445596+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/notifications.rb:168:in `block in instrument'
2018-09-14T17:43:33.445603+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
2018-09-14T17:43:33.445605+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/notifications.rb:168:in `instrument'
2018-09-14T17:43:33.445606+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/action_controller/metal/instrumentation.rb:32:in `process_action'
2018-09-14T17:43:33.445608+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/action_controller/metal/params_wrapper.rb:256:in `process_action'
2018-09-14T17:43:33.445610+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.1/lib/active_record/railties/controller_runtime.rb:24:in `process_action'
2018-09-14T17:43:33.445612+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/abstract_controller/base.rb:134:in `process'
2018-09-14T17:43:33.445613+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionview-5.2.1/lib/action_view/rendering.rb:32:in `process'
2018-09-14T17:43:33.445621+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/action_controller/metal.rb:252:in `dispatch'
2018-09-14T17:43:33.445615+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/action_controller/metal.rb:191:in `dispatch'
2018-09-14T17:43:33.445623+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/action_dispatch/routing/route_set.rb:52:in `dispatch'
2018-09-14T17:43:33.445626+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/action_dispatch/routing/mapper.rb:18:in `block in <class:Constraints>'
2018-09-14T17:43:33.445624+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/action_dispatch/routing/route_set.rb:34:in `serve'
2018-09-14T17:43:33.445628+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/action_dispatch/routing/mapper.rb:48:in `serve'
2018-09-14T17:43:33.445629+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/action_dispatch/journey/router.rb:52:in `block in serve'
2018-09-14T17:43:33.445631+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/action_dispatch/journey/router.rb:35:in `each'
2018-09-14T17:43:33.445633+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/action_dispatch/journey/router.rb:35:in `serve'
2018-09-14T17:43:33.445635+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/action_dispatch/routing/route_set.rb:840:in `call'
2018-09-14T17:43:33.445636+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/warden-1.2.7/lib/warden/manager.rb:36:in `block in call'
2018-09-14T17:43:33.445638+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/warden-1.2.7/lib/warden/manager.rb:35:in `catch'
2018-09-14T17:43:33.445640+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/warden-1.2.7/lib/warden/manager.rb:35:in `call'
2018-09-14T17:43:33.445642+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/rack-2.0.5/lib/rack/tempfile_reaper.rb:15:in `call'
2018-09-14T17:43:33.445644+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/rack-2.0.5/lib/rack/etag.rb:25:in `call'
2018-09-14T17:43:33.445645+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/rack-2.0.5/lib/rack/conditional_get.rb:38:in `call'
2018-09-14T17:43:33.445647+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/rack-2.0.5/lib/rack/head.rb:12:in `call'
2018-09-14T17:43:33.445649+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/action_dispatch/http/content_security_policy.rb:18:in `call'
2018-09-14T17:43:33.445650+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/rack-2.0.5/lib/rack/session/abstract/id.rb:232:in `context'
2018-09-14T17:43:33.445652+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/rack-2.0.5/lib/rack/session/abstract/id.rb:226:in `call'
2018-09-14T17:43:33.445654+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/action_dispatch/middleware/cookies.rb:670:in `call'
2018-09-14T17:43:33.445656+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
2018-09-14T17:43:33.445662+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:98:in `run_callbacks'
2018-09-14T17:43:33.445664+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
2018-09-14T17:43:33.445673+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
2018-09-14T17:43:33.445665+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/action_dispatch/middleware/debug_exceptions.rb:61:in `call'
2018-09-14T17:43:33.445675+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/railties-5.2.1/lib/rails/rack/logger.rb:38:in `call_app'
2018-09-14T17:43:33.445679+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/tagged_logging.rb:71:in `block in tagged'
2018-09-14T17:43:33.445680+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/tagged_logging.rb:28:in `tagged'
2018-09-14T17:43:33.445677+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/railties-5.2.1/lib/rails/rack/logger.rb:26:in `block in call'
2018-09-14T17:43:33.445684+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/railties-5.2.1/lib/rails/rack/logger.rb:26:in `call'
2018-09-14T17:43:33.445682+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/tagged_logging.rb:71:in `tagged'
2018-09-14T17:43:33.445685+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
2018-09-14T17:43:33.445687+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/action_dispatch/middleware/request_id.rb:27:in `call'
2018-09-14T17:43:33.445688+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/rack-2.0.5/lib/rack/method_override.rb:22:in `call'
2018-09-14T17:43:33.445690+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/rack-2.0.5/lib/rack/runtime.rb:22:in `call'
2018-09-14T17:43:33.445692+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.1/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
2018-09-14T17:43:33.445694+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/action_dispatch/middleware/executor.rb:14:in `call'
2018-09-14T17:43:33.445695+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/actionpack-5.2.1/lib/action_dispatch/middleware/static.rb:127:in `call'
2018-09-14T17:43:33.445699+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/railties-5.2.1/lib/rails/engine.rb:524:in `call'
2018-09-14T17:43:33.445701+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/puma-3.12.0/lib/puma/configuration.rb:225:in `call'
2018-09-14T17:43:33.445697+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/rack-2.0.5/lib/rack/sendfile.rb:111:in `call'
2018-09-14T17:43:33.445702+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/puma-3.12.0/lib/puma/server.rb:658:in `handle_request'
2018-09-14T17:43:33.445704+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/puma-3.12.0/lib/puma/server.rb:472:in `process_client'
2018-09-14T17:43:33.445706+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/puma-3.12.0/lib/puma/server.rb:332:in `block in run'
2018-09-14T17:43:33.445707+00:00 app[web.1]: [1499438e-5bd8-4a70-b4ab-85fbeb7cafe1] vendor/bundle/ruby/2.3.0/gems/puma-3.12.0/lib/puma/thread_pool.rb:133:in `block in spawn_thread'
2018-09-14T17:43:33.450275+00:00 heroku[router]: at=info method=POST path="/users" host=boiling-chamber-89366.herokuapp.com request_id=1499438e-5bd8-4a70-b4ab-85fbeb7cafe1 fwd="71.239.123.112" dyno=web.1 connect=0ms service=433ms status=500 bytes=1827 protocol=https
2018-09-14T17:43:33.594196+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=boiling-chamber-89366.herokuapp.com request_id=dc35e8ef-67b0-48da-aa81-58570d67edf8 fwd="71.239.123.112" dyno=web.1 connect=0ms service=3ms status=304 bytes=48 protocol=https

【问题讨论】:

    标签: ruby-on-rails heroku actionmailer production-environment devise-confirmable


    【解决方案1】:

    强烈敦促您使用 Gmail 以外的其他工具从您的应用程序发送电子邮件。 Gmail 非常适合交互式使用,但不是为应用程序批量使用而设计的。有许多服务更适合。

    Heroku agrees:

    为什么我在通过 SMTP 使用 Gmail 发送电子邮件时会出错?

    问题

    使用 Gmail 发送电子邮件的应用程序因错误而失败。

    分辨率

    Gmail 已采取保护措施来避免其服务被用于发送垃圾邮件,但出于安全原因并未发布这些保护措施。但是,我们经常看到客户应用程序尝试使用 Gmail 帐户进行电子邮件递送的问题,但随后被阻止。

    为确保从 Heroku 上运行的应用程序可靠地发送电子邮件,我们建议在此处使用众多电子邮件插件之一:https://elements.heroku.com/addons 其中许多都为中低容量电子邮件提供了良好的免费计划以及出色的分析和报告功能。

    【讨论】:

    • 再次感谢 Chris 鼓励我研究其他选项。我从 gmail 切换到 sendgrid-ruby,它运行良好。
    • 它确实解决了我的问题,但现在我遇到了一个新问题。我的 MacBook Pro 崩溃了,启动时无法重新加载磁盘映像。哦。这就是你不断推送到 github 的原因。在过去的一两天里,我失去了所有的工作。通常我对提交和推送很虔诚,但我被抓住了。
    • 很遗憾听到这个消息。祝您系统还原顺利。
    • 谢谢克里斯。是的,硬盘被转储了。猜猜是时候在这台旧 MacBook 上安装 SSD 了。
    猜你喜欢
    • 1970-01-01
    • 2017-03-16
    • 2011-05-25
    • 1970-01-01
    • 1970-01-01
    • 2011-12-22
    • 1970-01-01
    • 2013-01-04
    • 1970-01-01
    相关资源
    最近更新 更多