Problems with RMagick 1.5

Last week one of our webistes went down for some unknown reason, and I’ve found this kind of error message in production.log:

LoadError (Expected xy file to define ...)

Of course this is a useless error message which means Rails couldn’t find a controller file which has been still at its proper path of course. What to do now? If you need a more detailed error log, there is a solution to force Rails to log errors in deeper detail, just set your caching classes to true in your environment.rb file:

config.cache_classes = true

After restarting the webserver, and reloading the page, I could get a proper and useful error message, Rails pointed that the error is in RMagick gems. Take a quick look on the new error message in the log:

RuntimeError (This version of RMagick was created to run with ImageMagick 6.3.3
but ImageMagick 6.3.6 is installed on this system. You should either
1) Configure and build RMagick for ImageMagick 6.3.6, or
2) download ImageMagick 6.3.3 from file:///usr/local/share/doc/ImageMagick-6.3.3/index.html and install it.
):

Now this is something what you can use to start debugging. After reinstalling RMagick, the problem has been solved, and the site was up and online again. Just do the following 3 easy steps:

gem uninstall rmagick
gem install rmagick
apachectl restart

Done, you can get back processing your images.


Leave a Reply