galetahub / ckeditor

Ckeditor 4.x integration gem for rails

Home Page:https://ckeditor.com/ckeditor-4/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

uninitialized constant Ckeditor::Picture

CaioFML opened this issue · comments

Hello, guys, I recently upgrade rails to 6 and now I having troubles with models inside module Ckeditor that was generated automatically in ckeditor folder, rails is not finding this classes.

uninitialized constant Ckeditor::Picture

Im using in application.rb:
config.autoload_paths += %W[#{config.root}/app/models/ckeditor]

Any thoughts?

@CaioFML
Hi, there.
You look like completed this issue. How did you solve it?? I still have the same problem on Rails 6.0

I am also experiencing the same issue with the CKEditor gem 4.3.0 on Rails 6.1.7.3. Would like to know if there was any fix or other solution, @CaioFML ?

FYI, I was finally able to resolve this issue, and ckeditor is now working in our recently updated to Rails 7.0.8 application.

In Rails 6.1 and onward, autoloading does not work (see https://guides.rubyonrails.org/v7.0.0/upgrading_ruby_on_rails.html#autoloading-during-initialization).

The solution for me was to remove the following from my config/application.rb file entirely:

config.autoload_paths += %W(#{config.root}/app/models/ckeditor)

Commenting this line out resulted in the removal of the error message uninitialized constant Ckeditor::Picture as well as the related uninitialized constant Ckeditor::Attachment_File errors.

I hope that this is helpful for others who are trying to troubleshoot this issue; I'm not absolutely certain it will work, but it may help you in finding a solution.