Expected to define

My solution for this kind issue is

in app/controllers/application_controller.rb see if the below code
matches in the first line

class ApplicationController < ActionController::Base