I was having a heck of a time getting this to work, and still am. I'll get to the heart of it. I'm following Ryan Bates tutorial to make cropping work using Jcrop and Carrierwave. I've opted to use MiniMagick because even after reinstalling ImageMagick and RMagick on my machine I get an error that kills the rails server on my local machine. Anyway switching to MiniMagick fixed that for me. So everything is really nice up until this point. I have different sized images being produced, and they're being uploaded successfully. But once I try to crop I get this error:
undefined method `crop!' for #<MiniMagick::CommandBuilder:0x000001052e4608>
This is confusing the heck out of me because I'm using pretty much the exact same code as Bates:
def crop
if model.crop_x.present?
resize_to_limit(700, 700)
manipulate! do |img|
x = model.crop_x.to_i
y = model.crop_y.to_i
w = model.crop_w.to_i
h = model.crop_h.to_i
img.crop!(x, y, w, h)
end
end
end
Anyway, it's that crop method that's failing. So I thought to myself, that's an ImageMagick command... So I looked at the ImageMagick doco, and I couldn't find the crop method with the bang, so I tried it without, and then the error turns to this:
No such file or directory - /var/folders/dF/dFNM2+Y7FVScn4+OxVHKOU+++TI/-Tmp-/mini_magick20111207-34409-1tnaa07.jpg
Anyway, something isn't making a ton of sense to me, any help would be appreciated! Thanks for reading!