# RMagick : stranges errors on Windows

**URL:** <https://www.ruby-forum.com/t/rmagick-stranges-errors-on-windows/185877>\
**Category:** Ruby\
**Created:** [March 28, 2010, 6:55am UTC](https://www.ruby-forum.com/t/rmagick-stranges-errors-on-windows/185877 "2010-03-28T06:55:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Traz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/5fc32e/32.png) [@Traz](https://www.ruby-forum.com/u/Traz)\
**Post date:** [March 28, 2010, 6:55am UTC](https://www.ruby-forum.com/t/rmagick-stranges-errors-on-windows/185877/1 "2010-03-28T06:55:56Z")

</div>

Hi,  
I’ve tried several configuration on RMagick and i’ve got same error on  
all.

Multiple tests (in rmagick/test path) failed and someone crah ruby :

on irb :  
require ‘RMagick’  
img = Magick::Image.new(20,20)  
f = File.new(“test.0”, “w”)  
img.write(f) { self.format = “JPEG” } # → ruby crash

example take from RMagick/test/Image3.rb line 986

And a very strange error (having it trying to play with the new gem  
Dragonfly, witch do a call to list all format supported by RMagick) :

require ‘RMagick’  
Magick::formats

> > Magick::ImageMagickError: image coder signature mismatch `XTRN': 4c26e48 != 66008 @ error/module.c/OpenModule/1271 from d:/Ruby/lib/ruby/gems/1.8/gems/rmagick-2.13.1/lib/ RMagick.rb:20:in `init\_formats’  
> > from d:/Ruby/lib/ruby/gems/1.8/gems/rmagick-2.13.1/lib/  
> > RMagick.rb:20:in `formats’  
> > from (irb):3

but if you do it a second time :

Magick::formats

> > =\> {“PCDS”=\>“\*rw-”, “MNG”=\>“\*rw+”, “GRB”=\>“\*rw+”, … as expected

Note that ImageMagick correctly installed (the command “identify -list  
format” does a call on the same function i presume and it work fine).

I’ve tried several configuration (Win XP / Vista / Ruby 1.8.6  
mswin32 / Ruby 1.8.7 mingw32 / full install binary gem ImageMagick  
2.9.0/2.12.0-mswin32 Rubyforge / ImageMagick 6.4.8 / 6.5.3 / 6.5.8 /  
6.5.9 … ) all with the same error.

Finaly tried to build native RMagick gem in simple step on Vista /  
ruby 1.8.7 (2010-01-10 patchlevel 249) [i386-mingw32] with devkit  
installed : (step find from GoogleGroups RubyInstaller)

- install latest ImageMagick-6.6.0-10-Q8-windows-dll.exe from  
ImageMagick site ( [Index of /archive/binaries](http://www.imagemagick.org/download/binaries/) )
- donwload latest RMagick bundle from GitHub (  
[GitHub - rmagick/rmagick: Ruby bindings for ImageMagick](http://github.com/rmagick/rmagick)  
)
- build the gem :  
gem build rmagick.gemspec
- set the paths :  
set ImageMagickPath=your path to \ImageMagick-6.6.0-Q8

set PATH=%ImageMagickPath%;%PATH%  
set CPATH=%ImageMagickPath%\include;%CPATH%  
set LIBRARY\_PATH=%ImageMagickPath%\lib;%LIBRARY\_PATH%

- install the native gem :  
gem install rmagick --local --no-rdoc --no-ri

Compile fine with no error, but with all the latest library, got the  
same error on Magick::formats …

Have you got some ideas ??
