Search code examples
ruby-on-railsminimagick

minimagick No method "resize"


Rails noob here so I'm not sure what I'm doing wrong.

We're replacing a lot of paperclip functionality with mini_magick. It seemed pretty straight forward until I realized that for some reason the fact that we have a class called Image was blowing things up.

I renamed the Image class in MiniMagick and that fixed that problem, but then we also had a method called method_missing, which was also in MiniMagick.

Renamed all references etc., to magick_method_missing and now I'm getting the following error.

undefined method `resize' for #<MiniMagick::ImageEditor:0x2b236a98c9f8>

(ImageEditor is the renamed class).

This is my first time having to deal with plugins in our system. All of my other experience has been really simple, "gem install ..." lol. Does anyone know what I might be missing?

For now I'm just going to go through the code line by line to see if I missed a reference somewhere. That's the only thing I can think of.


Solution

  • Why would you rename classes and methods in 3rd party code?

    And method_missing is called whenever a method is not found. If I remember right MiniMagick uses it for calls to the binary, renaming it wont work, it has to be named method_missing.

    As far as using a plugin goes, you can use the gem. Its homepage is located here.