加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ckeditor运行在生产Rails应用程序与Heroku的问题

发布时间:2020-12-14 00:49:08 所属栏目:百科 来源:网络整理
导读:我在Rails 4应用程序中使用ckeditor gem. 一切在本地和我的登台heroku环境都很好,但是当推动生产环境时,我会得到这个错误: GET http://myapp.herokuapp.com/assets/ckeditor/contents.css 404 (Not Found)GET http://myapp.herokuapp.com/assets/ckeditor/s
我在Rails 4应用程序中使用ckeditor gem.
一切在本地和我的登台heroku环境都很好,但是当推动生产环境时,我会得到这个错误:
GET http://myapp.herokuapp.com/assets/ckeditor/contents.css 404 (Not Found)
GET http://myapp.herokuapp.com/assets/ckeditor/skins/moono/icons.png 404 (Not Found)

编辑器显示得很好,但所有图标都丢失.

我遵循了README(https://github.com/galetahub/ckeditor),但我可能会错过一些东西.

这是我的步骤:

1)宝石安装,生成等

2)application.js中的config.autoload_paths =%W(#{config.root} / app / models / ckeditor)

3)mount Ckeditor :: Engine => “/ ckeditor”在routes.rb(我不明白为什么)

4)在application.js中

//= require ckeditor/override
//= require ckeditor/init

这是做什么,为什么需要覆盖? (这些文件位于哪些位置,因为/ app / assets中没有,/ lib / assets中都没有/ vendor / assets)

Heroku是只读的,因此我无法按照教程中的说明运行耙子任务.
我认为这就是为什么我在生产模式中得到错误.

有人面临这个问题吗?
我经历了所有的stackoverflow问题,但是北极解决了我的问题到目前为止.

更新:

我发现使其工作的唯一方法是实时编译:config.assets.compile = true
但是我不想在生产中使用它,我不明白为什么它的工作.

目前这个问题的解决方案已经改变了.

没有必要包括“ckeditor / override.js”

1更新你的宝石.

bundle update ckeditor

2将此行添加到您的文件config / application.rb

config.assets.precompile += Ckeditor.assets
config.assets.precompile += %w( ckeditor/* )
config.autoload_paths += %W(#{config.root}/app/models/ckeditor)

对我来说,希望也适合你.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读