无法在Heroku中使用设计gem登录Rails 5应用程序



在一个疯狂的时刻,我决定做一个Rails 5应用程序,使用设计gem和Omniauth。一切似乎都在开发环境中工作(尽管我还没有配置它从那里发送电子邮件…鸭子们经过了!=D),但当我把它推到Heroku和迁移(甚至当我尝试重新启动dyno时),我不能使用有效的电子邮件和密码登录(或通过omniauth,但这是预期的),当我尝试注册时,创建了帐户,但没有发送身份验证电子邮件。我无法重新发送确认邮件,当我试图通过Heroku的rails控制台确认现有帐户时,我无法使用应用程序上的遗忘密码链接重置帐户密码。无论我做什么,我都会收到通用的500错误,建议我检查我的日志。据我所知,问题似乎是与设计或ActionMailer作为网站的其余部分正确加载。

我尝试在以下页面更改Gmail设置:

显示解锁验证码

不太安全的应用程序(我没有使用我的Rails 4应用程序最近)

我试过对配置文件进行各种调整,但到目前为止没有任何效果。

Heroku的日志(当我试图从网站发送忘记密码的电子邮件时)

 2016-08-27T08:22:49.275213+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:232:in `block in conditional'
 2016-08-27T08:22:49.275273+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:456:in `block in call'
 2016-08-27T08:22:49.275332+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:456:in `call'
 2016-08-27T08:22:49.275302+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:456:in `each'
 2016-08-27T08:22:49.275656+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activerecord-5.0.0.1/lib/active_record/transactions.rb:334:in `rollback_active_record_state!'
 2016-08-27T08:22:49.275713+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activerecord-5.0.0.1/lib/active_record/suppressor.rb:41:in `save'
 2016-08-27T08:22:49.275774+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/bundler/gems/devise-4c3838bb759e/lib/devise/models/recoverable.rb:45:in `send_reset_password_instructions'
 2016-08-27T08:22:49.275362+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:101:in `__run_callbacks__'
 2016-08-27T08:22:49.275509+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/transaction.rb:202:in `within_new_transaction'
 2016-08-27T08:22:49.275391+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:750:in `_run_commit_callbacks'
 2016-08-27T08:22:49.275155+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:382:in `block in make_lambda'
 2016-08-27T08:22:49.275420+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activerecord-5.0.0.1/lib/active_record/transactions.rb:354:in `committed!'
 2016-08-27T08:22:49.275451+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/transaction.rb:87:in `commit_records'
 2016-08-27T08:22:49.275684+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activerecord-5.0.0.1/lib/active_record/transactions.rb:318:in `save'
 2016-08-27T08:22:49.276127+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:101:in `__run_callbacks__'
 2016-08-27T08:22:49.276268+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
 2016-08-27T08:22:49.275479+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/transaction.rb:178:in `commit_transaction'
 2016-08-27T08:22:49.276857+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_controller/metal.rb:262:in `dispatch'
 2016-08-27T08:22:49.276997+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/mapper.rb:46:in `serve'
 2016-08-27T08:22:49.275241+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:456:in `call'
 2016-08-27T08:22:49.277110+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/route_set.rb:725:in `call'
 2016-08-27T08:22:49.277194+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:186:in `call!'
 2016-08-27T08:22:49.277251+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:186:in `call!'
 2016-08-27T08:22:49.277279+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call'
 2016-08-27T08:22:49.277307+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/warden-1.2.6/lib/warden/manager.rb:35:in `block in call'
 2016-08-27T08:22:49.277447+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/rack-2.0.1/lib/rack/head.rb:12:in `call'
 2016-08-27T08:22:49.277630+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:750:in `_run_call_callbacks'
 2016-08-27T08:22:49.277658+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:90:in `run_callbacks'
 2016-08-27T08:22:49.277856+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/tagged_logging.rb:70:in `block in tagged'
 2016-08-27T08:22:49.278095+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/executor.rb:12:in `call'
 2016-08-27T08:22:49.275538+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:232:in `transaction'
 2016-08-27T08:22:49.275567+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activerecord-5.0.0.1/lib/active_record/transactions.rb:211:in `transaction'
 2016-08-27T08:22:49.275597+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activerecord-5.0.0.1/lib/active_record/transactions.rb:392:in `with_transaction_returning_status'
 2016-08-27T08:22:49.275859+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
 2016-08-27T08:22:49.275927+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_controller/metal/rendering.rb:30:in `process_action'
 2016-08-27T08:22:49.276069+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:455:in `call'
 2016-08-27T08:22:49.276211+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/abstract_controller/callbacks.rb:19:in `process_action'
 2016-08-27T08:22:49.276296+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/notifications.rb:164:in `block in instrument'
 2016-08-27T08:22:49.276800+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionview-5.0.0.1/lib/action_view/rendering.rb:30:in `process'
 2016-08-27T08:22:49.277223+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call'
 2016-08-27T08:22:49.277587+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:97:in `__run_callbacks__'
 2016-08-27T08:22:49.277799+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.1/lib/rails/rack/logger.rb:36:in `call_app'
 2016-08-27T08:22:49.278008+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/rack-2.0.1/lib/rack/method_override.rb:22:in `call'
 2016-08-27T08:22:49.278133+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/static.rb:136:in `call'
 2016-08-27T08:22:49.275626+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activerecord-5.0.0.1/lib/active_record/transactions.rb:319:in `block in save'
 2016-08-27T08:22:49.275743+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/bundler/gems/devise-4c3838bb759e/lib/devise/models/recoverable.rb:88:in `set_reset_password_token'
 2016-08-27T08:22:49.275802+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/bundler/gems/devise-4c3838bb759e/lib/devise/models/recoverable.rb:119:in `send_reset_password_instructions'
 2016-08-27T08:22:49.275901+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/abstract_controller/base.rb:188:in `process_action'
 2016-08-27T08:22:49.275956+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
 2016-08-27T08:22:49.275984+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:126:in `call'
 2016-08-27T08:22:49.276012+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:126:in `call'
 2016-08-27T08:22:49.276041+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:506:in `block (2 levels) in compile'
 2016-08-27T08:22:49.276466+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activerecord-5.0.0.1/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
 2016-08-27T08:22:49.277082+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/journey/router.rb:26:in `serve'
 2016-08-27T08:22:49.277532+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/cookies.rb:613:in `call'
 2016-08-27T08:22:49.277714+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
 2016-08-27T08:22:49.278038+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/rack-2.0.1/lib/rack/runtime.rb:22:in `call'
 2016-08-27T08:22:49.276098+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:455:in `call'
 2016-08-27T08:22:49.276381+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
 2016-08-27T08:22:49.276885+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
 2016-08-27T08:22:49.277504+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/rack-2.0.1/lib/rack/session/abstract/id.rb:216:in `call'
 2016-08-27T08:22:49.278267+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/puma-3.6.0/lib/puma/server.rb:415:in `process_client'
 2016-08-27T08:22:49.276155+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:750:in `_run_process_action_callbacks'
 2016-08-27T08:22:49.276239+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_controller/metal/rescue.rb:20:in `process_action'
 2016-08-27T08:22:49.276437+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/searchkick-1.3.3/lib/searchkick/logging.rb:153:in `process_action'
 2016-08-27T08:22:49.277025+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/journey/router.rb:39:in `block in serve'
 2016-08-27T08:22:49.277391+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/rack-2.0.1/lib/rack/etag.rb:25:in `call'
 2016-08-27T08:22:49.277884+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/tagged_logging.rb:26:in `tagged'
 2016-08-27T08:22:49.278352+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/puma-3.6.0/lib/puma/thread_pool.rb:116:in `block in spawn_thread'
 2016-08-27T08:22:49.276324+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
 2016-08-27T08:22:49.276352+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/notifications.rb:164:in `instrument'
 2016-08-27T08:22:49.276913+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/route_set.rb:32:in `serve'
 2016-08-27T08:22:49.276969+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/mapper.rb:46:in `call'
 2016-08-27T08:22:49.277743+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/debug_exceptions.rb:49:in `call'
 2016-08-27T08:22:49.277828+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.1/lib/rails/rack/logger.rb:24:in `block in call'
 2016-08-27T08:22:49.277914+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/tagged_logging.rb:70:in `tagged'
 2016-08-27T08:22:49.277980+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/request_id.rb:24:in `call'
 2016-08-27T08:22:49.278239+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/puma-3.6.0/lib/puma/server.rb:578:in `handle_request'
 2016-08-27T08:22:49.276409+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_controller/metal/params_wrapper.rb:248:in `process_action'
 2016-08-27T08:22:49.277560+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/callbacks.rb:38:in `block in call'
 2016-08-27T08:22:49.277686+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/callbacks.rb:36:in `call'
 2016-08-27T08:22:49.277167+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call'
 2016-08-27T08:22:49.277336+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/warden-1.2.6/lib/warden/manager.rb:34:in `catch'
 2016-08-27T08:22:49.277953+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.1/lib/rails/rack/logger.rb:24:in `call'
 2016-08-27T08:22:49.275829+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/bundler/gems/devise-4c3838bb759e/app/controllers/devise/passwords_controller.rb:13:in `create'
 2016-08-27T08:22:49.276184+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:90:in `run_callbacks'
 2016-08-27T08:22:49.277054+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/journey/router.rb:26:in `each'
 2016-08-27T08:22:49.277139+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:186:in `call!'
 2016-08-27T08:22:49.277419+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/rack-2.0.1/lib/rack/conditional_get.rb:38:in `call'
 2016-08-27T08:22:49.276773+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/abstract_controller/base.rb:126:in `process'
 2016-08-27T08:22:49.276828+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_controller/metal.rb:190:in `dispatch'
 2016-08-27T08:22:49.276941+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/mapper.rb:16:in `block in <class:Constraints>'
 2016-08-27T08:22:49.277364+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/warden-1.2.6/lib/warden/manager.rb:34:in `call'
 2016-08-27T08:22:49.277475+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/rack-2.0.1/lib/rack/session/abstract/id.rb:222:in `context'
 2016-08-27T08:22:49.277771+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
 2016-08-27T08:22:49.278067+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
 2016-08-27T08:22:49.278154+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/rack-2.0.1/lib/rack/sendfile.rb:111:in `call'
 2016-08-27T08:22:49.278184+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.1/lib/rails/engine.rb:522:in `call'
 2016-08-27T08:22:49.278211+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/puma-3.6.0/lib/puma/configuration.rb:225:in `call'
 2016-08-27T08:22:49.278324+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/puma-3.6.0/lib/puma/thread_pool.rb:116:in `call'
 2016-08-27T08:22:49.278296+00:00 app[web.1]: [0635e4c5-2a5f-467e-b067-a9906868f73d] vendor/bundle/ruby/2.2.0/gems/puma-3.6.0/lib/puma/server.rb:275:in `block in run'

我当前的Gemfile

source 'https://rubygems.org'
gem 'rails', '~> 5.0.0', '>= 5.0.0.1'
gem 'pg', '~> 0.18'
gem 'puma', '~> 3.0'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.7'
gem 'jquery-rails'
gem 'sprockets', '>=3.0.0.beta'
#gem 'sprockets-es6'
gem 'haml'
gem 'nokogiri'
gem 'devise', git: 'https://github.com/plataformatec/devise.git', branch: 'master'
gem 'omniauth'
gem 'omniauth-facebook'
gem 'omniauth-twitter'
gem 'omniauth-instagram'
gem 'cancancan'
gem 'figaro'
gem 'humanize_boolean'
gem 'carrierwave', git: 'https://github.com/carrierwaveuploader/carrierwave'
gem 'mini_magick', '~> 3.8.0'
gem 'fog'
gem 'geocoder'
gem 'elasticsearch-model', git: 'https://github.com/elasticsearch/elasticsearch-rails.git'
gem 'elasticsearch-rails', git: 'https://github.com/elasticsearch/elasticsearch-rails.git'
gem 'searchkick'
gem 'cocoon'
gem 'owlcarousel-rails'
# Use Capistrano for deployment
 gem 'capistrano-rails', group: :development
group :test do
  gem 'selenium-webdriver'
end
group :development, :test do
  gem 'pry-byebug', platform: :mri
  gem 'rspec-rails'
  gem 'simplecov'
  gem 'factory_girl_rails'
  gem 'launchy'
  gem 'cucumber-rails', :require => false
  gem 'database_cleaner'
  gem 'faker'
  gem 'rails-controller-testing'
  gem 'capybara'
  gem 'jasmine'
end
group :development do
  gem 'web-console'
  gem 'listen', '~> 3.0.5'
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
group :production do
  gem 'rails_12factor'
  gem 'aws-sdk'
end

配置/环境/production.rb

 Rails.application.configure do
   config.cache_classes = true
   config.eager_load = true
   config.consider_all_requests_local       = false
   config.action_controller.perform_caching = true
   config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
   config.assets.js_compressor = :uglifier
   config.assets.compile = true
   config.log_level = :debug
   config.log_tags = [ :request_id ]
   config.action_mailer.perform_caching = false
   config.action_mailer.raise_delivery_errors = false
   config.action_mailer.default_url_options = { 
     host: ENV["MAILER_HOST"], #Rails.application.secrets.mailer_host, 
     from: ENV["MAILER_FROM"]#Rails.application.secrets.mailer_from
   }
   Rails.application.routes.default_url_options[:host] = ENV["MAILER_HOST"]#Rails.application.secrets.mailer_host
   config.action_mailer.delivery_method = :smtp
   config.action_mailer.perform_deliveries = true
   config.action_mailer.smtp_settings = {
     address: "smtp.gmail.com",
     port: 587,
     domain: ENV["GMAIL_DOMAIN"],#Rails.application.secrets.gmail_domain,
     authentication: :plain,
     enable_starttls_auto: true,
     user_name: ENV["GMAIL_USERNAME"],#Rails.application.secrets.gmail_username,
     password: ENV["GMAIL_PASSWORD"]#Rails.application.secrets.gmail_password
   }

   config.i18n.fallbacks = true
   config.active_support.deprecation = :notify
   config.log_formatter = ActiveSupport::Logger::Formatter.new
   # require 'syslog/logger'
   # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
   if ENV["RAILS_LOG_TO_STDOUT"].present?
     logger           = ActiveSupport::Logger.new(STDOUT)
     logger.formatter = config.log_formatter
     config.logger = ActiveSupport::TaggedLogging.new(logger)
   end
   config.active_record.dump_schema_after_migration = false
   Elasticsearch::Model.client = Elasticsearch::Client.new host: ENV['SEARCHBOX_SSL_URL']
 end

正如您所看到的,我最初尝试从secrets文件(其中包含环境变量名称并引用回Heroku的配置设置)访问环境变量,但后来尝试将变量直接添加到配置文件本身。然而,将这些新变化推到Heroku并没有产生太大的变化。

配置初始化/devise.rb

Devise.setup do |config|
  config.mailer_sender = ENV["MAILER_FROM"]
  config.mailer = 'Devise::Mailer'
  config.parent_mailer = 'ActionMailer::Base'
  require 'devise/orm/active_record'
  config.authentication_keys = [:email]
  config.strip_whitespace_keys = [:email]
  config.http_authenticatable = false
  config.skip_session_storage = [:http_auth]
  config.stretches = Rails.env.test? ? 1 : 11
  config.confirmation_keys = [:email]
  config.password_length = 6..128
  config.email_regexp = /A[^@s]+@[^@s]+z/
  config.reset_password_within = 6.hours
  config.sign_out_via = :delete
  config.omniauth :twitter, ENV["TWITTER_APP_ID"], ENV["TWITTER_APP_SECRET"]# Rails.application.secrets.twitter_app_id, Rails.application.secrets.twitter_app_secret
  config.omniauth :facebook, ENV["FACEBOOK_APP_ID"], ENV["FACEBOOK_APP_SECRET"]# Rails.application.secrets.facebook_app_id, Rails.application.secrets.facebook_app_secret
  config.omniauth :instagram,  ENV["INSTAGRAM_APP_ID"], ENV["INSTAGRAM_APP_SECRET"]# Rails.application.secrets.instagram_app_id, Rails.application.secrets.instagram_app_secret
end
<<p> 设计路线/strong>
  devise_scope :squatter do
    devise_for :squatters, controllers: { 
      sessions: "squatters/sessions",
      registrations: "squatters/registrations",
      passwords: "squatters/passwords",
      confirmations: "squatters/confirmations",
      omniauth_callbacks: "squatters/omniauth_callbacks" 
    }
  end
  resources :squatters, only: [:index, :show] do
    member do
      get :submissions_pending_approval
    end
    resources :messages, except: [:destroy, :edit, :index]
  end

为我正在使用的模型设计设置

  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable, 
         :confirmable, :omniauthable, omniauth_providers: [:facebook, :twitter, :instagram]

我的大多数设计控制器在它们继承的控制器上调用super。我唯一改变的是万能者。我主要是按照一个教程的多重全能身份(sourcey.com/rails-4-omniauth-using-devise-with-twitter-facebook-and-linkedin),所以这可能是一个转移注意力。

class Squatters::OmniauthCallbacksController < Devise::OmniauthCallbacksController
  def self.provides_callback_for(provider)
    class_eval %Q{
      def #{provider}
    @squatter = Squatter.find_for_oauth(env["omniauth.auth"], current_squatter)
    if @squatter.persisted?
      sign_in_and_redirect @squatter, event: :authentication
      set_flash_message(:notice, :success, kind: "#{provider}".capitalize) if is_navigational_format?
    else
      session["devise.#{provider}_data"] = env["omniauth.auth"]
      redirect_to new_squatter_registration_url
    end
      end
    }
  end
  [:twitter, :facebook, :instagram].each do |provider|
    provides_callback_for provider
  end
  def after_sign_in_path_for(resource)
    if resource.email_verified?
      super resource
    else
      finish_signup_path(resource)
    end
  end
end

如前所述,我已经尝试运行heroku run rake db:migrate --app my_apps_name并尝试运行heroku restart --app my_apps_name。有没有人知道我可能遗漏了什么,或者这只是表明最新版本的设计中存在错误?

嗨,你检查你的config/environments文件夹了吗?你有生产。Rb和开发。Rb文件。当您安装设计时,您必须在您的开发中包含此config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }。Rb文件,这是发送密码确认链接和重置密码链接。你在制作中加入这个了吗?rb文件?如果你在heroku上托管,它应该是你的应用程序的链接。

请在您的heroku应用程序中尝试此配置。

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

我的错误是由Searchkick gem引起的,它与Heroku的搜索框插件的试用版不兼容。当我试图将secret_key_base环境变量添加到设计的初始化文件时,我才注意到,当我试图重置密码时,我开始在Heroku的日志中看到重新索引错误。注释掉模型中的searchkick行解决了这个问题,现在我可以登录了,&c.

最新更新