CK 编辑器图像上传在 rails 5 app + carrierwave 的生产中不起作用
CK editor image uploading is not working in production with rails 5 app + carrierwave
我正在使用 CK 编辑器,在部署后我无法上传任何图像,但它正在开发中。我收到此错误 "image source url is missing",这是我的 config.js 文件:
我发现很多都有同样的错误,但没有人回答为什么会这样,所以我应该迁移到另一个编辑器还是什么?!
config.js
I, [2018-02-02T12:48:12.886841 #16570] INFO -- : [5a150ff6-afb3-4f98-a1cb-c954703b971d] Parameters: {"upload"=>#<ActionDispatch::Http::UploadedFile:0x00007f51110b4668 @tempfile=#<Tempfile:/tmp/RackMultipart20180202-16570-1g62x7e.jpg>, @original_filename="ibrahim.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"upload\"; filename=\"ibrahim.jpg\"\r\nContent-Type: image/jpeg\r\n">, "ckCsrfToken"=>"7n2JrWACJV1ceGDYnu1SUaY1p9iWr0Q4P0b40nQv", "CKEditor"=>"post_content", "CKEditorFuncNum"=>"1", "langCode"=>"en"}
I, [2018-02-02T12:48:12.892512 #16570] INFO -- : [5a150ff6-afb3-4f98-a1cb-c954703b971d] Completed 401 Unauthorized in 6ms (ActiveRecord: 0.0ms)
F, [2018-02-02T12:48:12.895003 #16570] FATAL -- : [5a150ff6-afb3-4f98-a1cb-c954703b971d]
F, [2018-02-02T12:48:12.895093 #16570] FATAL -- : [5a150ff6-afb3-4f98-a1cb-c954703b971d] MiniMagick::Error (ImageMagick/GraphicsMagick is not installed):
F, [2018-02-02T12:48:12.895128 #16570] FATAL -- : [5a150ff6-afb3-4f98-a1cb-c954703b971d]
F, [2018-02-02T12:48:12.895216 #16570] FATAL -- : [5a150ff6-afb3-4f98-a1cb-c954703b971d] mini_magick (4.8.0) lib/mini_magick/configuration.rb:127:in `cli'
[5a150ff6-afb3-4f98-a1cb-c954703b971d] mini_magick (4.8.0) lib/mini_magick.rb:38:in `graphicsmagick?'
[5a150ff6-afb3-4f98-a1cb-c954703b971d] mini_magick (4.8.0) lib/mini_magick/tool.rb:126:in `executable'
[5a150ff6-afb3-4f98-a1cb-c954703b971d] mini_magick (4.8.0) lib/mini_magick/tool.rb:110:in `command'
那么,你能上传一张图片并进行检查,看看它在看什么地方吗?他可能正在查看一个文件夹,而您准备查看其他地方。您是否在生产模式下预编译了资产?
我的应用程序中有这个配置:
/* Filebrowser routes */
// The location of an external file browser, that should be launched when "Browse Server" button is pressed.
config.filebrowserBrowseUrl = "/ckeditor/attachment_files";
// The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Flash dialog.
config.filebrowserFlashBrowseUrl = "/ckeditor/attachment_files";
// The location of a script that handles file uploads in the Flash dialog.
config.filebrowserFlashUploadUrl = "/ckeditor/attachment_files";
// The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Link tab of Image dialog.
config.filebrowserImageBrowseLinkUrl = "/ckeditor/pictures";
// The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Image dialog.
config.filebrowserImageBrowseUrl = "/ckeditor/pictures";
// The location of a script that handles file uploads in the Image dialog.
config.filebrowserImageUploadUrl = "/ckeditor/pictures";
// The location of a script that handles file uploads.
config.filebrowserUploadUrl = "/ckeditor/attachment_files";
在您的配置/初始值设定项/ckeditor 中,您是否取消了任何注释?在你的配置/application.rb中,你有没有放这样的东西?
config.assets.precompile += Ckeditor.assets
config.assets.precompile += %w( ckeditor/* ckeditor_assets/* *.png *.jpg *.jpeg *.gif img/*)
config.encoding = "utf-8"
config.assets.paths << "#{Rails}/vendor/assets/*"
config.autoload_paths += %w(#{config.root}/app/models/ckeditor)
嗯,你能post了解更多详情吗?你是用哪个上传carrierwave or paperclip 还是其他的?
我正在使用 CK 编辑器,在部署后我无法上传任何图像,但它正在开发中。我收到此错误 "image source url is missing",这是我的 config.js 文件:
我发现很多都有同样的错误,但没有人回答为什么会这样,所以我应该迁移到另一个编辑器还是什么?!
config.js
I, [2018-02-02T12:48:12.886841 #16570] INFO -- : [5a150ff6-afb3-4f98-a1cb-c954703b971d] Parameters: {"upload"=>#<ActionDispatch::Http::UploadedFile:0x00007f51110b4668 @tempfile=#<Tempfile:/tmp/RackMultipart20180202-16570-1g62x7e.jpg>, @original_filename="ibrahim.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"upload\"; filename=\"ibrahim.jpg\"\r\nContent-Type: image/jpeg\r\n">, "ckCsrfToken"=>"7n2JrWACJV1ceGDYnu1SUaY1p9iWr0Q4P0b40nQv", "CKEditor"=>"post_content", "CKEditorFuncNum"=>"1", "langCode"=>"en"}
I, [2018-02-02T12:48:12.892512 #16570] INFO -- : [5a150ff6-afb3-4f98-a1cb-c954703b971d] Completed 401 Unauthorized in 6ms (ActiveRecord: 0.0ms)
F, [2018-02-02T12:48:12.895003 #16570] FATAL -- : [5a150ff6-afb3-4f98-a1cb-c954703b971d]
F, [2018-02-02T12:48:12.895093 #16570] FATAL -- : [5a150ff6-afb3-4f98-a1cb-c954703b971d] MiniMagick::Error (ImageMagick/GraphicsMagick is not installed):
F, [2018-02-02T12:48:12.895128 #16570] FATAL -- : [5a150ff6-afb3-4f98-a1cb-c954703b971d]
F, [2018-02-02T12:48:12.895216 #16570] FATAL -- : [5a150ff6-afb3-4f98-a1cb-c954703b971d] mini_magick (4.8.0) lib/mini_magick/configuration.rb:127:in `cli'
[5a150ff6-afb3-4f98-a1cb-c954703b971d] mini_magick (4.8.0) lib/mini_magick.rb:38:in `graphicsmagick?'
[5a150ff6-afb3-4f98-a1cb-c954703b971d] mini_magick (4.8.0) lib/mini_magick/tool.rb:126:in `executable'
[5a150ff6-afb3-4f98-a1cb-c954703b971d] mini_magick (4.8.0) lib/mini_magick/tool.rb:110:in `command'
那么,你能上传一张图片并进行检查,看看它在看什么地方吗?他可能正在查看一个文件夹,而您准备查看其他地方。您是否在生产模式下预编译了资产?
我的应用程序中有这个配置:
/* Filebrowser routes */
// The location of an external file browser, that should be launched when "Browse Server" button is pressed.
config.filebrowserBrowseUrl = "/ckeditor/attachment_files";
// The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Flash dialog.
config.filebrowserFlashBrowseUrl = "/ckeditor/attachment_files";
// The location of a script that handles file uploads in the Flash dialog.
config.filebrowserFlashUploadUrl = "/ckeditor/attachment_files";
// The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Link tab of Image dialog.
config.filebrowserImageBrowseLinkUrl = "/ckeditor/pictures";
// The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Image dialog.
config.filebrowserImageBrowseUrl = "/ckeditor/pictures";
// The location of a script that handles file uploads in the Image dialog.
config.filebrowserImageUploadUrl = "/ckeditor/pictures";
// The location of a script that handles file uploads.
config.filebrowserUploadUrl = "/ckeditor/attachment_files";
在您的配置/初始值设定项/ckeditor 中,您是否取消了任何注释?在你的配置/application.rb中,你有没有放这样的东西?
config.assets.precompile += Ckeditor.assets
config.assets.precompile += %w( ckeditor/* ckeditor_assets/* *.png *.jpg *.jpeg *.gif img/*)
config.encoding = "utf-8"
config.assets.paths << "#{Rails}/vendor/assets/*"
config.autoload_paths += %w(#{config.root}/app/models/ckeditor)
嗯,你能post了解更多详情吗?你是用哪个上传carrierwave or paperclip 还是其他的?