簡體   English   中英

Heroku中的資產編譯Ckeditor導軌

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM