如何将 CKEditor 与 Heroku 集成?
这有点棘手,因为 Heroku 在 Dyno Grid 上使用只读文件系统。
这意味着当尝试远程安装 ckeditor 时,我收到错误:
heroku rake db:migrate
rake aborted!
Read-only file system - /disk1/home/slugs/362142_8858805_b85c-f2f3955d-f087-4bc4-8b1b-b6e898403a10/mnt/public/javascripts/ckcustom.js
ckcustom.js 是一个用于管理 ckeditor 元设置的配置文件。我想知道其他人是否也遇到过这些麻烦,他们做了什么来解决这些麻烦?
This is a bit tricky because Heroku uses a Read-only Filesystem across their Dyno Grid.
Which means when trying to install ckeditor remotely, I get an error :
heroku rake db:migrate
rake aborted!
Read-only file system - /disk1/home/slugs/362142_8858805_b85c-f2f3955d-f087-4bc4-8b1b-b6e898403a10/mnt/public/javascripts/ckcustom.js
ckcustom.js is a config file to manage your meta settings for ckeditor. I was wondering if anyone else had these troubles, and what they did to get around them?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您是否有理由不将其提交到 git 并将其与源代码的其余部分一起推送到 heroku?我从来没有必要使用heroku 配置CKeditor,但这应该可以工作。
Is there a reason why you're not just committing it to git and pushing it to heroku along with the rest of your source? I've never had to configure CKeditor with heroku, but that ought to work AFAIK.
出现这个错误的原因是Heroku运行在我的生产环境上。由于 CKEditor 是在新环境中设置的,因此它会尝试写入一堆文件。由于 Heroku 是只读文件系统,因此它会中止此进程。为了绕过此错误:
在本地计算机上,执行以下操作:
查看您的站点,CKeditor 将为生产环境写入这些文件。
现在应该了!
The reason this error occured was because Heroku ran on my production environment. Because CKEditor is being set up on a new environment, it attempts to write a bunch of files. Because Heroku is a read-only file system it aborts this process. In order to bypass this error :
On your local machine, perform this :
View your site, CKeditor will write those files for production env.
It should now!
一种便宜的方法是转到 easy_ckeditor/init.rb 并注释掉 check_and_install:
A cheap way to do it is to go to easy_ckeditor/init.rb and comment out the check_and_install:
对我有用的解决方案如下:
确保
然后将这些行添加到
config/application.rb
这在另一个堆栈溢出线程中得到了回答:使用 Heroku 在生产 Rails 应用程序上运行 ckeditor 时出现问题
The solution that worked for me was the following:
Make sure to
and then, add these lines to
config/application.rb
This was answered in this other stack overflow thread: Problems with ckeditor running on production Rails application with Heroku