1

我已经在我的 Rails 应用程序中安装了 ckeditor,按照此处的说明进行操作:https ://github.com/fxposter/rails_3_1_with_ckeditor_and_carrierwave Ckeditor 已加载且功能良好,但上传图片不起作用。我不知道为什么。当我上传图片时,它只显示加载动画,没有其他任何作用。但是图片实际上是上传的,我通过浏览我的应用程序文件夹就知道了,它位于 \public\tmp 中。但是当我再次浏览服务器时,它没有显示图像。当我浏览 sqlite 数据库时,我发现根本没有数据。这意味着,图片正在上传,但未能将资产信息保存在数据库中。在这种情况下我能做什么?

我的错误日志如下所示。

Started POST "/ckeditor/pictures?qqfile=Picture0004.jpg" for 127.0.0.1 at 2012-08-05 00:00:42 +0300
Processing by Ckeditor::PicturesController#create as */*
  Parameters: {"qqfile"=>"Picture0004.jpg"}
Completed 500 Internal Server Error in 268ms

Errno::ENOENT (No such file or directory - identify -ping -quiet -format "%w\n" "c:/RAILSapp/txtEdtr/public/uploads/tmp/20120805-0000-7596-2102/Picture0004.jpg"):
  subexec (0.2.2) lib/subexec.rb:71:in `spawn'
  subexec (0.2.2) lib/subexec.rb:71:in `spawn'
  subexec (0.2.2) lib/subexec.rb:55:in `run!'
  subexec (0.2.2) lib/subexec.rb:41:in `run'
  mini_magick (3.4) lib/mini_magick.rb:405:in `run'
  mini_magick (3.4) lib/mini_magick.rb:399:in `run_command'
  mini_magick (3.4) lib/mini_magick.rb:230:in `[]'
  C:/Ruby193/lib/ruby/gems/1.9.1/bundler/gems/ckeditor-7a987ee4c703/lib/ckeditor/backend/carrierwave.rb:57:in `read_dimensions'
  carrierwave (0.6.2) lib/carrierwave/uploader/processing.rb:85:in `block in process!'
  carrierwave (0.6.2) lib/carrierwave/uploader/processing.rb:81:in `each'
  carrierwave (0.6.2) lib/carrierwave/uploader/processing.rb:81:in `process!'
  carrierwave (0.6.2) lib/carrierwave/uploader/callbacks.rb:18:in `block in with_callbacks'
  carrierwave (0.6.2) lib/carrierwave/uploader/callbacks.rb:18:in `each'
  carrierwave (0.6.2) lib/carrierwave/uploader/callbacks.rb:18:in `with_callbacks'
  carrierwave (0.6.2) lib/carrierwave/uploader/cache.rb:112:in `cache!'

虽然得到它看起来像这样

Started GET "/ckeditor/pictures?CKEditor=test_area&CKEditorFuncNum=2&langCode=en" for 127.0.0.1 at 2012-08-05 00:27:57 +0300
Processing by Ckeditor::PicturesController#index as HTML
  Parameters: {"CKEditor"=>"test_area", "CKEditorFuncNum"=>"2", "langCode"=>"en"}
  [1m[35mCkeditor::Picture Load (0.0ms)[0m  SELECT "ckeditor_assets".* FROM "ckeditor_assets" WHERE "ckeditor_assets"."type" IN ('Ckeditor::Picture') ORDER BY id desc
  Rendered C:/Ruby193/lib/ruby/gems/1.9.1/bundler/gems/ckeditor-7a987ee4c703/app/views/ckeditor/shared/_asset.html.erb (0.0ms)
DEPRECATION WARNING: ActiveSupport::JSON::Variable is deprecated and will be removed in Rails 4.0. For your own custom JSON literals, define #as_json and #encode_json yourself. (called from new at C:/Ruby193/lib/ruby/gems/1.9.1/bundler/gems/ckeditor-7a987ee4c703/lib/ckeditor/utils.rb:12)
  Rendered C:/Ruby193/lib/ruby/gems/1.9.1/bundler/gems/ckeditor-7a987ee4c703/app/views/ckeditor/pictures/index.html.erb within layouts/ckeditor/application (5.0ms)
DEPRECATION WARNING: :confirm option is deprecated and will be removed from Rails 4.0. Use ':data => { :confirm => 'Text' }' instead. (called from _____uby____lib_ruby_gems_______bundler_gems_ckeditor__a___ee_c____app_views_ckeditor_shared__asset_tmpl_html_erb___29464367_32812632 at C:/Ruby193/lib/ruby/gems/1.9.1/bundler/gems/ckeditor-7a987ee4c703/app/views/ckeditor/shared/_asset_tmpl.html.erb:4)
  Rendered C:/Ruby193/lib/ruby/gems/1.9.1/bundler/gems/ckeditor-7a987ee4c703/app/views/ckeditor/shared/_asset_tmpl.html.erb (1.0ms)
Completed 200 OK in 52ms (Views: 23.0ms | ActiveRecord: 0.0ms)
4

0 回答 0