galetahub / ckeditor

Ckeditor 4.x integration gem for rails
https://ckeditor.com/ckeditor-4/
MIT License
2.22k stars 881 forks source link

The asset "ckeditor/application.css" is not present in the asset pipeline. #908

Closed CaioFML closed 3 years ago

CaioFML commented 3 years ago

Hello guys, I'm heaving some troubles with assets in Ckeditor::PicturesController#index, the title of this issue was the problem I have, I try to put in application.css this asset, and the problem change to:

ActionView::Template::Error Ckeditor::PicturesController#index
The asset "ckeditor/application.js" is not present in the asset pipeline.

Im using ruby 3.0, rails 6.1.3 and ckeditor 5.1, using this cdn "//cdn.ckeditor.com/4.13.1/full/ckeditor.js" what could cause this? :thinking:

nathancolgate commented 3 years ago

@CaioFML This popped up in our application this week as well. We are running ruby 2.7.2, rails 6.1.3.1 (recently upgraded) and ckeditor 4.2.4.

After some digging around, this commit came up:

https://github.com/galetahub/ckeditor/commit/7b40b09bb43105a675c8001dfa05c69aeca170d3

We were definitely using the old wildcard syntax, which may have been deprecated in sprocket-rails 3.2.0:

https://github.com/rails/sprockets-rails/issues/303

To fix it we had to change our assets initializer to be:

Rails.application.config.assets.precompile += %w[ckeditor/application.css]
Rails.application.config.assets.precompile += %w[ckeditor/application.js]

Which is different than the current installation instructions, but that might be due to the older version of the ckeditor gem.

Hope that helps.

CaioFML commented 3 years ago

@CaioFML This popped up in our application this week as well. We are running ruby 2.7.2, rails 6.1.3.1 (recently upgraded) and ckeditor 4.2.4.

After some digging around, this commit came up:

7b40b09

We were definitely using the old wildcard syntax, which may have been deprecated in sprocket-rails 3.2.0:

rails/sprockets-rails#303

To fix it we had to change our assets initializer to be:

Rails.application.config.assets.precompile += %w[ckeditor/application.css]
Rails.application.config.assets.precompile += %w[ckeditor/application.js]

Which is different than the current installation instructions, but that might be due to the older version of the ckeditor gem.

Hope that helps.

Thanks, @nathancolgate, it works!

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.