【发布时间】:2018-10-15 01:28:19
【问题描述】:
我正在尝试在 Rails 5 应用程序中使用 ckeditor gem。我将编译路径添加到 config/initializers/assets.rb:
Rails.application.config.assets.precompile += Ckeditor.assets
我可以看到它可以正确编译。问题是,在生产中,我得到 404 错误(在开发中工作正常):
Failed to load resource: the server responded with a status of 404 :assets/ckeditor/config.js?t=GB8C:1
这告诉我 ckeditor gem 引用的是硬编码的资产名称,而不是摘要命名的资产。有解决办法吗?
感谢您的帮助, 凯文
【问题讨论】:
-
你为什么做
+= Ckeditor.assets而不是README问的Rails.application.config.assets.precompile += %w( ckeditor/*)? -
我试过了,没用(同样的问题,它没有引用摘要命名的文件)
-
宝石版?你也从CDN or GEM vendor 加载它?
-
ckeditor (4.2.4) 和供应商
-
你在视图中是如何引用它的,我在这里假设你所做的配置是正确的,...就像they said
标签: ruby-on-rails ckeditor asset-pipeline