nbudin / devise_cas_authenticatable

CAS authentication support for Devise
MIT License
285 stars 117 forks source link

Unable to autoload constant Devise::CasSessionsController #134

Closed ctrl-dlahr closed 7 years ago

ctrl-dlahr commented 7 years ago

I have a rails project that works locally but when I put it on my development server I get the following error:

Unable to autoload constant Devise::CasSessionsController, expected /usr/local/rvm/gems/ruby-2.3.1/gems/devise_cas_authenticatable-1.9.2/app/controllers/devise/cas_sessions_controller.rb to define it

additionally it says:

Extracted source (around line #512):

else
      require_or_load(expanded, qualified_name)
      raise LoadError, "Unable to autoload constant #{qualified_name}, expected #{file_path} to define it" unless from_mod.const_defined?(const_name, false)
      return from_mod.const_get(const_name)
end
elsif mod = autoload_module!(from_mod, const_name, qualified_name, path_suffix)

Line 512 is:

raise LoadError, "Unable to autoload constant #{qualified_name}, expected #{file_path} to define it" unless from_mod.const_defined?(const_name, false)

any ideas on what might be causing this?

nbudin commented 7 years ago

Hmm. Try running this in a Rails console in development mode:

load '/usr/local/rvm/gems/ruby-2.3.1/gems/devise_cas_authenticatable-1.9.2/app/controllers/devise/cas_sessions_controller.rb'

You may get a different error that will be more helpful in tracking down the problem. If so, could you paste that here?

ctrl-dlahr commented 7 years ago

Hey,

Thanks for the reply. I redeployed the project with Unicorn on my development server. The problem stopped for about a day then happened again. This happens when logging in or logging out. (I am using devise.)

Below is the output from rails console.

2.3.1 :001 > load '/usr/local/rvm/gems/ruby-2.3.1/gems/devise_cas_authenticatable-1.9.2/app/controllers/devise/cas_sessions_controller.rb' DEPRECATION WARNING: skip_before_filter is deprecated and will be removed in Rails 5.1. Use skip_before_action instead. (called from irb_binding at (irb):1) => true