【问题标题】:Unable to upload and process image with CarrierWave and MiniMagick无法使用 CarrierWave 和 MiniMagick 上传和处理图像
【发布时间】:2012-12-28 15:26:55
【问题描述】:

我正在尝试使用 CarrierWave 和 MiniMagick 实现图像上传。我可以使用carrierwave上传图片,但是当我实现MiniMagick来调整上传图片的大小时,它返回了这个错误:

Errno::ENOENT in ItemsController#create

No such file or directory - identify -ping /var/folders/6y/j8zfcgmd02x5s439c0np8fjh0000gn/T/mini_magick20121228-71203-bdoeul.jpg

image_uploader.rb

class ImageUploader < CarrierWave::Uploader::Base

  include CarrierWave::MiniMagick

  storage :file

  def store_dir
    "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
  end

  version :thumb do
    process :resize_to_fill => [100, 100]
  end

end

我已经安装了 imagemagick。

【问题讨论】:

    标签: ruby-on-rails imagemagick carrierwave minimagick


    【解决方案1】:

    不确定出了什么问题,但在我卸载 MacPort 及其所有端口、安装 Homebrew 并重新安装 ImageMagick 后,一切正常。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-26
      • 1970-01-01
      • 2013-12-07
      • 2019-01-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多