簡體   English   中英

CK編輯器圖像上傳無法在Rails 5應用程序+載波中進行生產

[英]CK editor image uploading is not working in production with rails 5 app + carrierwave

我正在使用CK編輯器,部署后我無法上傳任何圖像,但是它正在開發中。 我收到此錯誤“圖像源URL丟失”,這是我的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";

在您的config / initializers / ckeditor中,您是否取消了注釋? 在您的config / 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)

好吧,您可以發布更多詳細信息嗎? 您正在使用哪個來上傳載波或回形針,或其他?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM