[英]Assets compilation Ckeditor rails in heroku
我在生产环境中使用Ckeditor时遇到麻烦。
我有2个环境(暂存和生产环境),它们都在Heroku中。
我可以在临时环境中看到Ckeditor,但不能看到产品。
我的配置如下: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 )
配置/初始化/ assets.rb:
Rails.application.config.assets.precompile += %w( ckeditor/* )
应用程序/资产/ Java脚本/ application.js中:
//= require ckeditor/init
(基本上遵循https://github.com/galetahub/ckeditor文档)
环境暂存和生产都使用RAILS_ENV = production。
我使用Amazon S3来提供资产,这很好,因为我可以看到生产中存在javascript功能,图标和图像。
有什么明显的我想念这里吗?
谢谢!
PS:我正在使用RoR 4.2和ckeditor 4.1.1
编辑:
1-我验证了在两种环境中提供的javascript,并且文件相同! 和Ckeditor javascript代码都存在。 因此,问题不在于资产预编译,而是其他……
2-存储桶中存在ckeditor.js文件,但我仍然从服务器收到404找不到响应。 该文件位于Assets / ckeditor / ckeditor-xxxx.js下
最后,我可以通过添加gem来解决此问题
gem 'non-stupid-digest-assets', '~> 1.0.4'
它无需摘要即可编译资产。
问题在于ckeditor资产是用摘要编译的,但是在代码中(gem内),没有摘要就直接引用了它。
希望它能对任何困扰这个问题的人有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.