1

I tried to upload a image using Carrierwave and the upload hanged on forever without concluding the upload or giving an error.

After that the server didn't respond to any more request, even after I restart it. When I start the server now, it starts normally, with the server log just saying "Connecting to database specified by database.yml". However, it doesn't respond to any requests, making the browser hang on forever waiting for a response (without throwing an error).

This happened after I tried to make an upload using the Carrierwave gem, so I think that might be related. Although I can't understand why/how this happens.

I'm sorry, as requested here it comes more information:

This is happening in development, in windows 8 and I'm using RMagick. I restarted the computer and the server started again to respond to requests. When I tried to make an upload the server did not respond to the request and hanged on indefinitely without throwing and error or a response. After that, the server stop responding to any request.

In the directory when the images should be stored I found a "tmp" directory with 2 images there, the original I uploaded and a "small" one, leaving me thinking that the problem is occurring after the first resize of RMagick.

Here is some data:

Rails version: 3.12.2 Carrierwave version: 0.8.0 RMagick version: 2.13.2 ImageMagick version: 6.8.1-0

The uploader class:

class ImageUploader < CarrierWave::Uploader::Base

  # Include RMagick or MiniMagick support:
  include CarrierWave::RMagick

  # Choose what kind of storage to use for this uploader:
  storage :file

  # Override the directory where uploaded files will be stored.   # This is a sensible default for uploaders that are meant to be mounted:
  def store_dir
    "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
  end

  # Provide a default URL as a default if there hasn't been a file uploaded:
  def default_url
    '/uploads/user/' + [version_name, 'no_photo.png'].compact.join('_')
  end

  version :small do
    process :resize_to_limit => [30, 30]
  end

  version :medium do
    process :resize_to_limit => [70, 70]
  end

  version :large do
    process :resize_to_limit => [125, 125]
  end

end
4

1 回答 1

0

无法理解问题是什么,但我在 unbuntu 中尝试了这个,它运行良好,所以这是一个 Windows 问题。可能它与 ImageMagick 函数有关(几乎所有与图像宝石和窗口有关的问题......)。

我会将这个答案标记为已解决,尽管没有对问题做出任何解释。

于 2013-06-04T22:18:50.790 回答