ckeditor运行在生产Rails应用程序与Heroku的问题
我在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是只读的,因此我无法按照教程中的说明运行耙子任务. 有人面临这个问题吗? 更新: 我发现使其工作的唯一方法是实时编译: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) 对我来说,希望也适合你. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |