Brighton Classified
Brighton Classifieds is an extremely high specification system with some of the most advanced features ever seen in a community based classifieds site.
Installing RMagick on Windows XP or Vista
RMagick is a ruby wrapper onto the popular Image Magick image manipulation tool. If you want to do any kind of dynamic image manipulation server side, this is the library for you.
We use it on the Apollo's Pad CMS to generate title images on the fly. The Apollo design called for the h2 titles to be in a non-standard font so we just uploaded the font to the server and had it create the header images as we needed them. We have also used it to create graphs of user entered data.
Contrary to what many people say, installing RMagick on Windows is acually quite straight forward. In a nutshell we first install a very specific version of the Image Magick application, then install the RMagick gem to allow Ruby to talk to it. Just follow these simple steps:
- First you need to grab the rmagick-win32 zip. This handy zip contains everything you will need and can be found here: http://rubyforge.org/frs/?group_id=12. Be sure to get the latest version that's compatible with your ruby install. Download it and unzip somewhere close to the root of your drive (eg C:\rails).
- In the zip is a bundled version of the Image Magick installer It will be called something like: ImageMagick-6.3.7-8-Q8-windows-dll.exe. RMagick will generally only work with this version and you need to have it installed, so install it first with a double click
- During installation, leave the "Update Executable Search Path" option checked. This will update your Path variable and allow Ruby to find the Image Magick Application.
- Restart any teminal windows you may have open. You need to do this as the Path variable has changed.
-
Test your installation. In a terminal type:
path
PATH=c:\program files\imagemagick-6.3.7-q8;c:\ruby\bin;C:\Windows\system32;Notice that the Path variable contains the path to the Image Magick install. Now to test the command line version of Image Magick so type:
convert logo: logo.miff
imdisplay logo.miffYou should see a big picture of the IM wizard.
-
Now to install the gem. First ensure you have the latest version of the Gem installer. Type:
gem update --system
This might take a few moments.
-
Now navigate to the directory where you unzipped everything. If you unzipped it somewhere near the root of your drive this should be easy. To install the gem type:
gem install rmagick --local
You should see something like:
Successfully installed rmagick-2.0.0-x86-mswin32
1 gem installed - Finally lets test the RMagick installation using irb. In a terminal type:
irb
require 'RMagick'If it's all working you should see:
=> true