I'm using the ckeditor gem in my Rails 4 application. Everything works great locally and on my staging heroku environment, but I get this errors when pushing on the production environment :
GET http://myapp.herokuapp.com/assets/ckeditor/contents.css 404 (Not Found)
GET http://myapp.herokuapp.com/assets/ckeditor/skins/moono/icons.png 404 (Not Found)
The editor shows up well, but all icons are missing.
I followed the README (https://github.com/galetahub/ckeditor), but I'm probably missing something.
Here are my steps:
1) Gem installation, generate etc ...
2) config.autoload_paths += %W(#{config.root}/app/models/ckeditor)
in application.js
3) mount Ckeditor::Engine => "/ckeditor"
in routes.rb (I don't understand why)
4) In application.js
//= require ckeditor/override
//= require ckeditor/init
What is this doing exactly, why is override needed ? (Where are located these files, because there are not in /app/assets
, neither in /lib/assets
neither in /vendor/assets
)
Heroku is read only oriented, therefore I can't run the rake task as explained in the tutorial. And I think this is why I get the errors in production mode.
Did anyone faced the same problem ? I ran through all stackoverflow questions, but nothing resolved my problem so far.
UPDATE :
The only way I found out to make it works is the live compilation : config.assets.compile = true
But I would prefer not to use this in production, and I don't understand why it does work.
Currently the solution for this problem has been changed.
There is no need to include "ckeditor/override.js"
1 Update your gem.
bundle update ckeditor
2 Add this line to your file config/application.rb
config.assets.precompile += Ckeditor.assets
config.assets.precompile += %w( ckeditor/* )
config.autoload_paths += %W(#{config.root}/app/models/ckeditor)
It works for me hope will work for you too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With