简体   繁体   中英

Assets compilation Ckeditor rails in heroku

I am having troubles using Ckeditor in production environment.

I have 2 environments, staging and production, both of them are in Heroku.

I am able to see Ckeditor in staging environment but not prod.

My configuration is the following: config/environments/production.rb:

# Precompile additional assets
config.assets.precompile += Ckeditor.assets
config.assets.precompile += %w( *.js )
config.assets.precompile += %w( .svg .eot .woff .ttf )

config/initializers/assets.rb:

Rails.application.config.assets.precompile += %w( ckeditor/* )

app/assets/javascripts/application.js:

//= require ckeditor/init

(Which basically following https://github.com/galetahub/ckeditor documentation)

Both environment staging and production use RAILS_ENV=production.

I use Amazon S3 to serve my assets, which fine, because i can see that the javascript functionnalities, icons and images are present in production.

Is there anything obvious that i am missing here ?

Thanks!

PS: I am using RoR 4.2 and ckeditor 4.1.1

EDIT:

1 - I verified the javascript served in both environment, and the file is the same ! and Ckeditor javascript code is present in both. So the issue is not asset precompilation but something else...

2 - The ckeditor.js file is present in the bucket but i'm still getting 404 not found response from server. The file is under assets/ckeditor/ckeditor-xxxx.js

Finally, i could fix this issue by adding the gem

gem 'non-stupid-digest-assets', '~> 1.0.4'

It compiles the asset without the digest.

The problem was that ckeditor assets were compiled with the digest, but in the code ( inside the gem ), it was referenced directly without digests.

Hope it will help whoever encouter this problem...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM