redactor-rails icon indicating copy to clipboard operation
redactor-rails copied to clipboard

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

Open ryanbelke opened this issue 8 years ago • 7 comments

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]'

ryanbelke avatar Sep 30 '16 03:09 ryanbelke

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.

nathandoig avatar Jan 18 '17 18:01 nathandoig

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

lgants avatar Feb 08 '17 22:02 lgants

please check controller file,is there any typo error

mdsikandar avatar Feb 09 '17 11:02 mdsikandar

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

RitaWoki avatar Mar 20 '17 14:03 RitaWoki

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

Ibr4him avatar Mar 30 '17 08:03 Ibr4him

ok thanks

On Thu, Mar 30, 2017 at 11:23 AM, Ibr4him [email protected] wrote:

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/SammyLin/redactor-rails/issues/162#issuecomment-290338410, or mute the thread https://github.com/notifications/unsubscribe-auth/AWY2zSwd1Nt4-vvnjvPDTtHcOdmJ5gVYks5rq2acgaJpZM4KKsrB .

RitaWoki avatar Mar 31 '17 14:03 RitaWoki

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

boydndonga avatar May 01 '17 00:05 boydndonga