【问题标题】:How to integrate CKEditor with Heroku?如何将 CKEditor 与 Heroku 集成?
【发布时间】:2010-11-29 18:47:38
【问题描述】:

这有点棘手,因为 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 的元设置。我想知道是否还有其他人有这些麻烦,以及他们做了什么来解决这些问题?

【问题讨论】:

  • 您尝试过这些步骤吗? joshcrews.com/blog/using-heroku-to-host-your-rails-cms 如果是这样,您可以发布失败的迁移文件吗?
  • 似乎他正在做的是从插件中提取所有文件并手动将它们嵌入应用程序本身。但它不会仍然在我的公共/目录中写入临时文件吗?我至少已经阅读了 rails-ckeditor 存储库二十次。
  • 你搞定了吗?自己做一个 db: 使用 ckeditor 应用程序在 heroku 上迁移时遇到错误
  • 是的,要解决这个问题,在本地运行服务器作为生产,然后将这些新文件添加到 heroku。你都准备好了

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


【解决方案1】:

您不只是将其提交到 git 并将其与其他源代码一起推送到 heroku,有什么原因吗?我从来不需要用 heroku 配置 CKeditor,但这应该可以 AFAIK。

【讨论】:

  • 我将其提交给 git,然后将其推送到 heroku,是的。然后在我这样做之后我执行rake db:migrate,这就是它失败的地方,这张票占用了。
【解决方案2】:

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

在您的本地机器上,执行此操作:

rails s -e production

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

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

现在应该!

【讨论】:

    【解决方案3】:

    一个便宜的方法是去easy_ckeditor/init.rb并注释掉check_and_install:

    #require 'ckeditor_file_utils'
    #CkeditorFileUtils.check_and_install
    

    【讨论】:

    • 这听起来很棒!
    • 它通过了测试,所以它是优质贫民区。 :-)
    • 这个文件在哪里。
    【解决方案4】:

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

    确保

    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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-10-12
      • 2021-01-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多