[ANN] Win32 gem for RMagick 1.9.1

T

Timothy Hunter

Hot on the heels of the latest RMagick update, Kaspar Schiess has
uploaded a Win32 gem for RMagick 1.9.1. This gem includes ImageMagick
6.2.3 as well as brand-new support for the JPEG2000 format. Thanks, Kaspar!

To install the gem, download the .zip file to a temp directory, unzip
it, and follow the instructions in the README file.

RMagick is an interface to the ImageMagick (www.imagemagick.org) and
GraphicsMagick (www.graphicsmagick.org) image processing libraries.
RMagick supports more than 90 image formats, including GIF, JPEG, and
PNG. RMagick now includes RVG, a 2D drawing API based on SVG. The
package includes comprehensive HTML documentation.
 
N

Nicholas Van Weerdenburg

par!
=20
Oop, forgot.
=20
The gem is available here:
http://rubyforge.org/frs/download.php/5998/RMagick-1.9.1-IM-6.2.3-win32.z= ip
=20
Visit the RMagick home page at: http://rmagick.rubyforge.org
=20
=20

I'm getting an error trying to install the gem:

D:\RMagick-1.9.1-IM-6.2.3-win32>gem install RMagick-win32-1.9.1-mswin32.gem
Attempting local installation of 'RMagick-win32-1.9.1-mswin32.gem'
ERROR: Error installing gem RMagick-win32-1.9.1-mswin32.gem[.gem]: buffer =
error


D:\RMagick-1.9.1-IM-6.2.3-win32>ruby -v
ruby 1.8.2 (2004-12-25) [i386-mswin32]

D:\RMagick-1.9.1-IM-6.2.3-win32>gem --version
0.8.11

Ruby is installed via the latest one-click installer.

Thanks,
Nick
 
K

Kaspar Schiess

Hello Nick,
D:\RMagick-1.9.1-IM-6.2.3-win32>gem install
RMagick-win32-1.9.1-mswin32.gem Attempting local installation of
'RMagick-win32-1.9.1-mswin32.gem' ERROR: Error installing gem
RMagick-win32-1.9.1-mswin32.gem[.gem]: buffer error
I can reproduce that on some machines, although not on my testing machines.
This is an error that somehow floats up trough the zlib library into
rubygems, there is even code in rubygems to avoid that error, but it seems
that it has hit again. (search for the words 'buffer' or 'error' in
package.rb from rubygems)

I cannot really say how to fix this, I tried for a whole afternoon to no
success. I guess replacing zlib.so would be an alternative, but I can't see
where to download one. You could also try to enable the error avoidance
branch in the above piece of code, maybe that solves the problem ?

If things get really tough, I can whip together a manual install, although
that again would be a lot of work.

Tell me what works for you
kaspar
 
N

Nicholas Van Weerdenburg

Hi Kaspar,

Thanks for the response.

I tried running again with --debug, and got the following:

D:\RMagick-1.9.1-IM-6.2.3-win32>gem install
RMagick-win32-1.9.1-mswin32.gem --debug
Exception `Errno::ENOENT' at
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:12 - No such
file or directory - D:\
User Profiles\nvanweerdenburg.PTCNET/.gemrc
Attempting local installation of 'RMagick-win32-1.9.1-mswin32.gem'
Exception `Zlib::BufError' at
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/package.rb:348 - buffer error
ERROR: Error installing gem RMagick-win32-1.9.1-mswin32.gem[.gem]: buffer =
error

putting some outputs into rubygems/package.rb:
@read=3D2682880, @size=3D8780608
len=3D2048
max_read=3D2048
@read=3D2684928, @size=3D8780608
len=3D2048
max_read=3D2048
@read=3D2686976, @size=3D8780608
len=3D2048
max_read=3D2048
@read=3D2689024, @size=3D8780608
len=3D2048
max_read=3D2048
@read=3D2691072, @size=3D8780608
len=3D2048
max_read=3D2048
Exception `Zlib::BufError' at c:/ruby/lib/ruby/site_ruby/1.8/rubygems/packa=
ge.rb
:352 - buffer error
ERROR: Error installing gem RMagick-win32-1.9.1-mswin32.gem[.gem]: buffer =
error

It looks like it was going okay until about a 1/3 of the way through
the current entry. A bunch run sucessfully before this one.

I'm rather stuck now. What's the manual install effort? Any hints or tips?

Thanks,
Nick

Hello Nick,
=20
D:\RMagick-1.9.1-IM-6.2.3-win32>gem install
RMagick-win32-1.9.1-mswin32.gem Attempting local installation of
'RMagick-win32-1.9.1-mswin32.gem' ERROR: Error installing gem
RMagick-win32-1.9.1-mswin32.gem[.gem]: buffer error
I can reproduce that on some machines, although not on my testing machine= s.
This is an error that somehow floats up trough the zlib library into
rubygems, there is even code in rubygems to avoid that error, but it seem= s
that it has hit again. (search for the words 'buffer' or 'error' in
package.rb from rubygems)
=20
I cannot really say how to fix this, I tried for a whole afternoon to no
success. I guess replacing zlib.so would be an alternative, but I can't s= ee
where to download one. You could also try to enable the error avoidance
branch in the above piece of code, maybe that solves the problem ?
=20
If things get really tough, I can whip together a manual install, althoug= h
that again would be a lot of work.
=20
Tell me what works for you
kaspar
=20
 
N

Nicholas Van Weerdenburg

Hello Nick,
=20
D:\RMagick-1.9.1-IM-6.2.3-win32>gem install
RMagick-win32-1.9.1-mswin32.gem Attempting local installation of
'RMagick-win32-1.9.1-mswin32.gem' ERROR: Error installing gem
RMagick-win32-1.9.1-mswin32.gem[.gem]: buffer error
I can reproduce that on some machines, although not on my testing machine= s.
This is an error that somehow floats up trough the zlib library into
rubygems, there is even code in rubygems to avoid that error, but it seem= s
that it has hit again. (search for the words 'buffer' or 'error' in
package.rb from rubygems)
=20
I cannot really say how to fix this, I tried for a whole afternoon to no
success. I guess replacing zlib.so would be an alternative, but I can't s= ee
where to download one. You could also try to enable the error avoidance
branch in the above piece of code, maybe that solves the problem ?
=20
If things get really tough, I can whip together a manual install, althoug= h
that again would be a lot of work.
=20
Tell me what works for you
kaspar
=20
--
code manufacture & ruby lab at http://www.tua.ch/ruby
=20
=20
=20

Hi Kaspar,

Thanks to your tip,=20

I changed=20
if Zlib::ZLIB_VERSION < '1.2.1'

to=20

if Zlib::ZLIB_VERSION <=3D '1.2.1'

in package.rb and it installed ( I think ).

Thanks,
Nick
 
N

Nicholas Van Weerdenburg

Hello Nick,
D:\RMagick-1.9.1-IM-6.2.3-win32>gem install
RMagick-win32-1.9.1-mswin32.gem Attempting local installation of
'RMagick-win32-1.9.1-mswin32.gem' ERROR: Error installing gem
RMagick-win32-1.9.1-mswin32.gem[.gem]: buffer error
I can reproduce that on some machines, although not on my testing machi= nes.
This is an error that somehow floats up trough the zlib library into
rubygems, there is even code in rubygems to avoid that error, but it se= ems
that it has hit again. (search for the words 'buffer' or 'error' in
package.rb from rubygems)

I cannot really say how to fix this, I tried for a whole afternoon to n= o
success. I guess replacing zlib.so would be an alternative, but I can't= see
where to download one. You could also try to enable the error avoidance
branch in the above piece of code, maybe that solves the problem ?

If things get really tough, I can whip together a manual install, altho= ugh
that again would be a lot of work.

Tell me what works for you
kaspar
=20
Hi Kaspar,
=20
Thanks to your tip,
=20
I changed
if Zlib::ZLIB_VERSION < '1.2.1'
=20
to
=20
if Zlib::ZLIB_VERSION <=3D '1.2.1'
=20
in package.rb and it installed ( I think ).
=20
Thanks,
Nick
=20

Now if I do "irb" and require "rmagick" I get an error dialog:

ruby.exe- Unable to Locate Component
The application has failed to start because libbz2.dll was not found.
Re-installing the application may fix this problem.

Any thoughts here?

Thanks,
Nick
--=20
Nicholas Van Weerdenburg
 
N

Nicholas Van Weerdenburg

Nick, did you run postinstall.rb?
=20
=20
=20

Thanks. I just realized that an ran it.

Now I get the following:
...warnings snipped...
c:/ruby/lib/ruby/gems/1.8/gems/RMagick-win32-1.9.1-mswin32/lib/rmagick.rb:1=
58:
warning: already initialized constant STR
ETCH_TYPE_NAMES
c:/ruby/lib/ruby/gems/1.8/gems/RMagick-win32-1.9.1-mswin32/lib/rmagick.rb:1=
64:
warning: already initialized constant STY
LE_TYPE_NAMES
NameError: undefined method `assoc' for class `Magick::ImageList'
from c:/ruby/lib/ruby/gems/1.8/gems/RMagick-win32-1.9.1-mswin32/lib=
/rmagick.rb:1002:in
`undef_method'
from c:/ruby/lib/ruby/gems/1.8/gems/RMagick-win32-1.9.1-mswin32/lib=
/rmagick.rb:1002
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:i=
n
`require__'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:i=
n
`require'

Any thoughts here?

Thanks,
Nick
--=20
Nicholas Van Weerdenburg
 
T

Timothy Hunter

Nicholas said:
Thanks. I just realized that an ran it.

Now I get the following:
..warnings snipped...
c:/ruby/lib/ruby/gems/1.8/gems/RMagick-win32-1.9.1-mswin32/lib/rmagick.rb:158:
warning: already initialized constant STR
ETCH_TYPE_NAMES
c:/ruby/lib/ruby/gems/1.8/gems/RMagick-win32-1.9.1-mswin32/lib/rmagick.rb:164:
warning: already initialized constant STY
LE_TYPE_NAMES
NameError: undefined method `assoc' for class `Magick::ImageList'
from c:/ruby/lib/ruby/gems/1.8/gems/RMagick-win32-1.9.1-mswin32/lib/rmagick.rb:1002:in
`undef_method'
from c:/ruby/lib/ruby/gems/1.8/gems/RMagick-win32-1.9.1-mswin32/lib/rmagick.rb:1002
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require__'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'

Any thoughts here?

Thanks,
Nick

These are the kind of messages that I'd expect if you somehow loaded
RMagick.rb twice. Is there any way that could be happening?
 
N

Nicholas Van Weerdenburg

=20
These are the kind of messages that I'd expect if you somehow loaded
RMagick.rb twice. Is there any way that could be happening?
=20
=20

It was loading twice, as I noticed with some debug statements.

Turns out I was using require "rmagick" rather then require "RMagick"
which seems to work properly.

Thanks,
Nick
 
S

senor.j.onion

Yeah - I get that exact same error. Just re-installed my computer.
Everything fresh. XP2, latest, Ruby, latest RubyGems ... nothing much
else on my machine ...
 
S

senor.j.onion

I mean this error (sorry):

D:\RMagick-1.9.1-IM-6.2.3-win32>gem install
RMagick-win32-1.9.1-mswin32.gem
Attempting local installation of 'RMagick-win32-1.9.1-mswin32.gem'
ERROR: Error installing gem RMagick-win32-1.9.1-mswin32.gem[.gem]:
buffer error

Joerg Diekmann
 
T

Timothy Hunter

I mean this error (sorry):

D:\RMagick-1.9.1-IM-6.2.3-win32>gem install
RMagick-win32-1.9.1-mswin32.gem
Attempting local installation of 'RMagick-win32-1.9.1-mswin32.gem'
ERROR: Error installing gem RMagick-win32-1.9.1-mswin32.gem[.gem]:
buffer error

Joerg Diekmann
Did you see Kaspar's suggested workaround earlier in this thread?

Change
if Zlib::ZLIB_VERSION < '1.2.1'

to

if Zlib::ZLIB_VERSION <= '1.2.1'

in package.rb.
 
K

Kaspar Schiess

Did you see Kaspar's suggested workaround earlier in this thread?
Change
if Zlib::ZLIB_VERSION < '1.2.1'

to

if Zlib::ZLIB_VERSION <= '1.2.1'

in package.rb.

Hi Timothy,

Are you on the rubygems list ? I would like for someone to crosspost this
bug there. I guess the bug is in zlib, but Rubygems could work around it.

The zlib bug seems to have surfaced at one point, then have been fixed,
but not completely as it seems.

I am hesitant as to just changing that gem around and tweaking the bytes
to make things work, since then the bug will just dive once more. Very
possible it has something of a Heisenbug, so making it reproducable on
Windows machines sounds like something good...

Anyone of the important people reacting to this ? Should probably repost
under a fresh subject. Though I hate going around sticking fingers at
people yelling 'you got a BUG, BUUUUG' ;)

what do you think ?

kaspar
code manufacture & ruby lab at http://www.tua.ch/ruby
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top