如何将CKEditor与Heroku集成?

时间:2010-11-29 18:47:38

标签: ruby-on-rails deployment heroku ckeditor readonly

这有点棘手,因为Heroku在他们的Dyno网格中使用只读文件系统。

这意味着当尝试远程安装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的元设置。我想知道是否有其他人有这些麻烦,以及他们做了什么绕过他们?

4 个答案:

答案 0 :(得分:0)

你有没有理由不把它作为git并将其与其他来源一起推送到heroku?我从来没有用heroku配置CKeditor,但是应该使用AFAIK。

答案 1 :(得分:0)

发生此错误的原因是因为Heroku在我的生产环境中运行。因为CKEditor是在新环境中设置的,所以它会尝试编写一堆文件。因为Heroku是一个只读文件系统,所以它会中止此过程。为了绕过这个错误:

在本地计算机上,执行以下操作:

rails s -e production

查看您的网站,CKeditor将为生产环境编写这些文件。

git add .
git commit -m "added files to Production for Heroku"
git push heroku master

现在应该!

答案 2 :(得分:0)

一种便宜的方法是转到easy_ckeditor / init.rb并注释掉check_and_install:

#require 'ckeditor_file_utils'
#CkeditorFileUtils.check_and_install

答案 3 :(得分:0)

对我有用的解决方案如下:

确保

bundle update ckeditor

然后,将这些行添加到config/application.rb

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

在其他堆栈溢出线程中回答了这个问题:Problems with ckeditor running on production Rails application with Heroku