We build Web & Mobile Applications.
Back in December I posted about ImageScience and RubyInline on Windows. Turns out I wasn’t the only one trying to get this combination working: according to Google Analytics it has become our second most popular blog entry.
A man who knows a lot about Ruby on Windows is Luis Lavena and a day after I posted he very kindly took the time to compile a Windows version of the ImageScience gem and instantly transformed 30 minutes of hard work into about 30 seconds of simplicity!
If you really like doing things the hard way then feel free to read my original post and try compiling everything for yourself, but if all you really want is to get up and running as quickly and painlessly as possible then here are the new ‘easy’ instructions (note: I’m assuming that you have Ruby installed and working in C:\Program Files\Ruby
):
Open a command prompt window and run:
gem install --include-dependencies RubyInline
At the time of writing this will install RubyInline version 3.6.6.
Download the FreeImage binary (at the time of writing version 3.10.0) and unzip to your desktop. Copy FreeImage.dll
from the dist directory to C:\Windows\system32
.
Download the Win32 ImageScience gem (at the time of writing version 1.1.3) and copy it to C:\Program Files\Ruby
.
Install the gem from a command prompt window using:
gem install "C:\Program Files\Ruby\image_science-1.1.3-i386-mswin32.gem"
You can then delete the gem file from C:\Program Files\Ruby
.
Open a command prompt window, type irb
to start a Ruby console and type:
require 'rubygems'
require 'image_science'
After the second require
You should see => true
as the result: if you get an error then check that you copied the FreeImage DLL to the correct location in step 3.
And that’s it you’re done!