Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ryanbelke opened this issue Sep 30, 2016 · 7 comments

Comments

@ryanbelke
Copy link

ryanbelke commented Sep 30, 2016

I am using rails 5 and unable to get the image uploader to work. When I try to upload the image nothing shows up and if I step through with byebug I get to this error. Any idea what could be causing this? From what I am reading it is saying that module names can only have a capital first letter and the gem uses RedactorRails
'
[[507, 516] in /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb
507:
508: if loading.include?(expanded)
509: raise "Circular dependency detected while autoloading constant #{qualified_name}"
510: else
511: require_or_load(expanded, qualified_name)
=> 512: raise LoadError, "Unable to autoload constant #{qualified_name}, expected #{file_path} to define it" unless from_mod.const_defined?(const_name, false)
513: return from_mod.const_get(const_name)
514: end
515: elsif mod = autoload_module!(from_mod, const_name, qualified_name, path_suffix)
516: return mod]'

@nathandoig
Copy link

nathandoig commented Jan 18, 2017

Having exact same error, have you solved this?

edit: I solved this myself turns out the one of the controller files had a typo.

I had UserControllers < ApplicationController
should be UserController < ApplicationController

so make sure your controller files are proper if you're having this same error.

@lgants
Copy link

lgants commented Feb 8, 2017

I'm having the same issue as well. It doesn't appear to be documented.

@mdsikandar
Copy link

please check controller file,is there any typo error

@RitaWoki
Copy link

the problem is in the controller,take a very good look at it and solve the error

@Ibr4him
Copy link

Ibr4him commented Mar 30, 2017

it is mostly typo in the first line of the controller page

@RitaWoki
Copy link

RitaWoki commented Mar 31, 2017 via email

@boydndonga
Copy link

have had a similar error while perfoming google-api authentication and as @Ibr4him points out, its the first line of your controller

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants