uninitialized constant MiniMagick::MiniMagickError

Posted by Christian-Manuel Butzke on December 23, 2008|Comments

Yesterday morning, the world still a better place, a slight breeze of warm sunlight could have made it even more colorful. So, I did not mind much as the rain wildly plundered upon me on the way to offices of my customer. Yet, I did not know that whatever or whoever rules the universe did not mean to let Germans have yet another day of victorious feelings. The universe has to be kept in balance, as I believe, so something had to happen after Germany won three games in a row with an unusual high score.

Germany – Australia 4:0
Germany – England 4:1
Germany – Argentine 4:0

But yet, little I knew about what was going on in the heads or whatever of whatever or whoever rules the universe, and even knowing THE answer – 42 – did not help that much. But a first sign, the ripple of an unfortunate day was roaring at me when I tried to run RSpec on our project, after doing an “bundle install”.

Just for reference, we are are running
- Ubuntu 10.04
- Rails 3 Beta 04
- mini_magick (1.3.0 1cffd3) (installed by bundler)

A never seen before error popped up:

  • uninitialized constant MiniMagick::MiniMagickError **

3) Deal image size validation should scale down a landscape image to be exactly 100 by 64 pixels
Failure/Error: @uploader.store!(File.open(file_name))
uninitialized constant MiniMagick::MiniMagickError

  1. /home/chris/.bundle/ruby/1.8/bundler/gems/carrierwave-9dd8738f4752a18c2c6c0a722070105dac5e4abd-master/lib/carrierwave/processing/mini_magick.rb:256:in `manipulate!’
  2. /home/chris/.bundle/ruby/1.8/bundler/gems/carrierwave-9dd8738f4752a18c2c6c0a722070105dac5e4abd-master/lib/carrierwave/processing/mini_magick.rb:177:in `resize_to_fill’
  3. /home/chris/.bundle/ruby/1.8/bundler/gems/carrierwave-9dd8738f4752a18c2c6c0a722070105dac5e4abd-master/lib/carrierwave/uploader/processing.rb:78:in `send’

With the back trace being inside the minimagick gem, it was obvious that, there was rather something odd going on.

A quick look at the source code of the mini_magick gem revealed, the obvious. There was no sign of a MiniMagickError class. Just an class called Error, yet, the source referenced to a MiniMagickError class.

A quick monkey patch in the environment fixed that up.

module MiniMagick
class MiniMagickError < RuntimeError; end

A small fix for a small problem…

Germany – Spain 0:1
It was a fair play with an exceptional strong Spain. However, as a German, I can not deny, that I wished Germany would have won. Even though I am not interested in soccer, or even watching games, but the FIFA finals are just that great. haha. I enjoyed watching it though.

blog comments powered by Disqus