
[英]How to crop image on upload with Rails, Carrierwave and Minimagick?
[英]Unable to upload and process image with CarrierWave and MiniMagick
我正在尝试使用CarrierWave和MiniMagick实现图像上传。 我可以使用载波上传图像,但是当我实现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。
不知道出了什么问题,但是在我卸载了MacPort及其所有端口,安装了Homebrew并重新安装了ImageMagick之后,一切都按预期进行了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.