0

当我尝试将图像插入我的博客时,我选择上传标签并选择我的文件和Send it to Server. 然后在我选择的 URL 选项卡上Browse Server,我收到以下错误:

ActiveRecord::StatementInvalid in Ckeditor::AttachmentFilesController#index

PG::Error: ERROR:  relation "ckeditor_assets" does not exist
LINE 5:              WHERE a.attrelid = '"ckeditor_assets"'::regclas...
                                    ^
:             SELECT a.attname, format_type(a.atttypid, a.atttypmod),
                 pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
          FROM pg_attribute a LEFT JOIN pg_attrdef d
            ON a.attrelid = d.adrelid AND a.attnum = d.adnum
         WHERE a.attrelid = '"ckeditor_assets"'::regclass
           AND a.attnum > 0 AND NOT a.attisdropped
         ORDER BY a.attnum

有任何想法吗?

编辑

我跳过了上述问题的迁移。但我仍然无法上传文件。我收到此错误:

Started POST "/ckeditor/attachment_files? CKEditor=blog_entry_body&CKEditorFuncNum=1&langCode=en" for 127.0.0.1 at 2013-05-24 18:10:29 -0500
Processing by Ckeditor::AttachmentFilesController#create as HTML
Parameters: {"upload"=>#<ActionDispatch::Http::UploadedFile:0x000000047e3c28 @original_filename="me.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"upload\"; filename=\"me.jpg\"\r\nContent-Type: image/jpeg\r\n", @tempfile=#<Tempfile:/tmp/RackMultipart20130524-27036-1g7t9yd>>, "CKEditor"=>"blog_entry_body", "CKEditorFuncNum"=>"1", "langCode"=>"en"}
WARNING: Can't verify CSRF token authenticity
User Load (0.5ms)  SELECT "users".* FROM "users" WHERE "users"."remember_token" = 'M96bQAv-NGdidsn7hypOJA' LIMIT 1
(0.2ms)  BEGIN
(0.3ms)  ROLLBACK
Rendered text template (0.0ms)

看起来它正在发生Ckeditor::AttachmentFilesController#create。但是当我安装 CKEditor gem 时,我没有看到这个控制器生成。我在另一篇文章中发现我必须skip_before_filter :verify_authenticity_token,但就像我说的,我没有看到Ckeditor::AttachmentFilesController#create

4

1 回答 1

0

该 SQL 是 ActiveRecord 用来计算 PostgreSQL 表的结构以及ActiveRecord::Base子类的属性的。“关系不存在”错误意味着您有一个CkeditorAssetActiveRecord 类(因此是ckeditor_assets表名)但没有ckeditor_assets表。您在某处错过了迁移,也许有一个用于初始化您忘记运行的 CKEditor 插件的生成器。

于 2013-05-24T22:40:16.920 回答