現在、Railsチュートリアルにて学習中の者です。
Sign in の時に、Sendgridにメールを送って認証したら、log inできるという機能を作っているのですが、Send gridの方にメールが届かないので、メール送信の処理に問題がないか試してみました。→ > heroku run rails console
すると、エラーが出ました。
Running rails console on ⬢ peaceful-ravine-95504... up, run.8934 (Free) Traceback (most recent call last): 49: from /app/bin/rails:9:in `<main>' 48: from /app/bin/rails:9:in `require' 47: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6/lib/rails/commands.rb:16:in `<top (required)>' 46: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6/lib/rails/command.rb:44:in `invoke' 45: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6/lib/rails/command/base.rb:63:in `perform' 44: from /app/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch' 43: from /app/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command' 42: from /app/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run' 41: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6/lib/rails/commands/console/console_command.rb:96:in `perform' 40: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6/lib/rails/command/actions.rb:16:in `require_application_and_environment!' 39: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6/lib/rails/application.rb:329:in `require_environment!' 38: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6/lib/rails/application.rb:329:in `require' 37: from /app/config/environment.rb:5:in `<top (required)>' 36: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6/lib/rails/application.rb:353:in `initialize!' 35: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6/lib/rails/initializable.rb:58:in `run_initializers' 34: from /app/vendor/ruby-2.5.5/lib/ruby/2.5.0/tsort.rb:205:in `tsort_each' 33: from /app/vendor/ruby-2.5.5/lib/ruby/2.5.0/tsort.rb:226:in `tsort_each' 32: from /app/vendor/ruby-2.5.5/lib/ruby/2.5.0/tsort.rb:347:in `each_strongly_connected_component' 31: from /app/vendor/ruby-2.5.5/lib/ruby/2.5.0/tsort.rb:347:in `call' 30: from /app/vendor/ruby-2.5.5/lib/ruby/2.5.0/tsort.rb:347:in `each' 29: from /app/vendor/ruby-2.5.5/lib/ruby/2.5.0/tsort.rb:349:in `block in each_strongly_connected_component' 28: from /app/vendor/ruby-2.5.5/lib/ruby/2.5.0/tsort.rb:431:in `each_strongly_connected_component_from' 27: from /app/vendor/ruby-2.5.5/lib/ruby/2.5.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component' 26: from /app/vendor/ruby-2.5.5/lib/ruby/2.5.0/tsort.rb:228:in `block in tsort_each' 25: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6/lib/rails/initializable.rb:59:in `block in run_initializers' 24: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6/lib/rails/initializable.rb:30:in `run' 23: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6/lib/rails/initializable.rb:30:in `instance_exec' 22: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6/lib/rails/application/finisher.rb:67:in `block in <module:Finisher>' 21: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6/lib/rails/application/finisher.rb:67:in `each' 20: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6/lib/rails/engine.rb:354:in `eager_load!' 19: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6/lib/rails/engine.rb:473:in `eager_load!' 18: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6/lib/rails/engine.rb:473:in `each' 17: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6/lib/rails/engine.rb:475:in `block in eager_load!' 16: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6/lib/rails/engine.rb:475:in `each' 15: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6/lib/rails/engine.rb:476:in `block (2 levels) in eager_load!' 14: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:251:in `require_dependency' 13: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:335:in `depend_on' 12: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:357:in `require_or_load' 11: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:36:in `load_interlock' 10: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.6/lib/active_support/dependencies/interlock.rb:11:in `loading' 9: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.6/lib/active_support/concurrency/share_lock.rb:149:in `exclusive' 8: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.6/lib/active_support/dependencies/interlock.rb:12:in `block in loading' 7: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:36:in `block in load_interlock' 6: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:379:in `block in require_or_load' 5: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require' 4: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in `load_dependency' 3: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `block in require' 2: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require' 1: from /app/app/controllers/sessions_controller.rb:1:in `<top (required)>' /app/app/controllers/sessions_controller.rb:7:in `<class:SessionsController>': undefined method ` ' for SessionsController:Class (NoMethodError)
session_controllerを確認しても、
エラーらしいエラーはありませんでした。
class SessionsController < ApplicationController # GET /login def new #@session = Session.new end # POST /login def create user = User.find_by(email: params[:session][:email]) if user && user.authenticate(params[:session][:password]) if user.activated? # Success log_in user params[:session][:remember_me] == '1' ? remember(user) : forget(user) redirect_back_or user else message = "Account not activated. " message += "Check your email for the activation link." flash[:warning] = message redirect_to root_url end else # Failure flash.now[:danger] = 'Invalid email/password combination' render 'new' end end # DELETE /logout def destroy log_out if logged_in? redirect_to root_url end end
問題があるのは他の部分でしょうか。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/09/17 14:32
2019/09/17 21:18
2019/09/18 03:46
2019/09/18 03:56