Fork me on GitHub

August 28, 2010

Simple Captcha without RMagick

Post moved to

Simple Captcha is as it's name points out is probably the simplest captcha plugin out there. It's a little old and not really updated these days (although there is some SimpleCaptcha3 activity) but still working as expected, at least on Rails 2.

Now, I know there's creatures among us developers who don't really prefer RMagick, which is the core brick of the plugin. Some popular image related "magick" plugins give us alternative options, probably the most common RMagick replacement being MiniMagick. Besides the usual reasons against RMagick I do found one crucial to be JRuby compatibility. There's an attempt to fix this called RMagick4J but it seems to be incomplete (at least for simple captcha it did not play correctly).

Turns out for captcha generation, MiniMagick ain't an option, it misses support for creating images from scratch which is essential. Fortunately, there's still hope thanks to QuickMagick, well that's about enough magick isn't it ?! Sure is, but it's worth it. QuickMagick mixes the simplicity of MiniMagick with the flexibility of RMagick (and works with JRuby).

Enough chit-chat, here's how to enjoy the simplest captcha plugin for Rails without RMagick :

The updated plugin lives at

UPDATE: The latest plugin version now works on Rails 3.0.0+ !

No comments:

Post a Comment