[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

gem.cmd install RMagick-win32-1.9.2-mswin32.gem: Buffer error

Clifford Heath

5/31/2006 7:52:00 AM

On Windows XP, under the cygwin "bash":

$ ruby --version
ruby 1.8.1 (2004-01-27) [i386-mswin32]

$ gem.cmd --version
0.8.11

$ gem.cmd install RMagick-win32-1.9.2-mswin32.gem
Attempting local installation of 'RMagick-win32-1.9.2-mswin32.gem'
ERROR: Error installing gem RMagick-win32-1.9.2-mswin32.gem[.gem]:
buffer error

What gives?
12 Answers

Tim Hunter

5/31/2006 10:11:00 PM

0

Clifford Heath wrote:
> On Windows XP, under the cygwin "bash":
>
> $ ruby --version
> ruby 1.8.1 (2004-01-27) [i386-mswin32]
>
> $ gem.cmd --version
> 0.8.11
>
> $ gem.cmd install RMagick-win32-1.9.2-mswin32.gem
> Attempting local installation of 'RMagick-win32-1.9.2-mswin32.gem'
> ERROR: Error installing gem RMagick-win32-1.9.2-mswin32.gem[.gem]:
> buffer error
>
> What gives?

The rmagick-win32 gem is for native Windows. For Cygwin you use the
regular rmagick gem or the RMagick source tarball.

See http://rmagick.rubyforge.org/instal.... Follow the
instructions for "Linux, FreeBSD, or other *nix-like system."

I should point out that several people have tried to install RMagick on
Cygwin lately and have not been successful. I don't know what the
problem is and I don't have access to a machine that runs Cygwin to test
it myself. If you get it to work I'd appreciate it if you'd let me know
what you did and what obstacles you had to overcome.

Clifford Heath

5/31/2006 10:49:00 PM

0

Tim Hunter wrote:
> The rmagick-win32 gem is for native Windows.

Ok, but I'm not using a cygwin Ruby - it's too slow.
It's a native Win32 Ruby.

> For Cygwin you use the
> regular rmagick gem or the RMagick source tarball.

Tried the source gem, but get different errors building it.
I'll post those later today if you wish.

> If you get it to work I'd appreciate it if you'd let me know
> what you did and what obstacles you had to overcome.

Will do. Thanks for your help.

Tim Hunter

5/31/2006 11:59:00 PM

0

Clifford Heath wrote:
> Tim Hunter wrote:
>> The rmagick-win32 gem is for native Windows.
>
> Ok, but I'm not using a cygwin Ruby - it's too slow.
> It's a native Win32 Ruby.

Hmmm...your first post said "under the cygwin 'bash'". Did I
misunderstand? If you're actually installing on normal, non-cygwin
Windows, then the rmagick-win32 gem is appropriate and we need to
address the "buffer error" problem.

>
>> For Cygwin you use the regular rmagick gem or the RMagick source tarball.
>
> Tried the source gem, but get different errors building it.
> I'll post those later today if you wish.
>
>> If you get it to work I'd appreciate it if you'd let me know what you
>> did and what obstacles you had to overcome.
>
> Will do. Thanks for your help.

Clifford Heath

6/1/2006 1:26:00 AM

0

Tim Hunter wrote:
> Hmmm...your first post said "under the cygwin 'bash'".

Yes. I launched the normal Win32 install from within bash.
The reason I mentioned bash and cygwin is that within bash
I have to use the explicit "gem.cmd" form, I can't just say
"gem ...".

> Did I misunderstand?

Only at first.

> If you're actually installing on normal, non-cygwin
> Windows, then the rmagick-win32 gem is appropriate and we need to
> address the "buffer error" problem.

Yes, please.

Tim Hunter

6/1/2006 11:29:00 AM

0

Clifford Heath wrote:
> Tim Hunter wrote:
>> Hmmm...your first post said "under the cygwin 'bash'".
>
> Yes. I launched the normal Win32 install from within bash.
> The reason I mentioned bash and cygwin is that within bash
> I have to use the explicit "gem.cmd" form, I can't just say
> "gem ...".
>
>> Did I misunderstand?
>
> Only at first.
>
>> If you're actually installing on normal, non-cygwin Windows, then the
>> rmagick-win32 gem is appropriate and we need to address the "buffer
>> error" problem.
>
> Yes, please.

See this RMagick forum thread:
http://rubyforge.org/forum/forum.php?thread_id=3457&f...

Let me know if this doesn't address your problem.

Clifford Heath

6/2/2006 12:07:00 AM

0

Tim Hunter wrote:
> See this RMagick forum thread:
> http://rubyforge.org/forum/forum.php?thread_id=3457&f...
> Let me know if this doesn't address your problem.

That didn't work, but this did (also in package.rb, zipped_stream):

def zipped_stream(entry)
# if Zlib::ZLIB_VERSION < '1.2.1'
# zis = Zlib::GzipReader.new entry
# dis = zis.read
# is = StringIO.new(dis)
# else
is = Zlib::GzipReader.new entry
# end
#ensure
# zis.finish if zis
end

BTW, ruby -e 'require "zlib"; p Zlib::ZLIB_VERSION' says
"1.1.4"

Thanks for pointing me in the right direction. Anything else you'd
like to know to find a definitive fix for this?

Clifford Heath.

Tim Hunter

6/2/2006 12:27:00 AM

0

Clifford Heath wrote:
> Tim Hunter wrote:
>> See this RMagick forum thread:
>> http://rubyforge.org/forum/forum.php?thread_id=3457&f...
>> Let me know if this doesn't address your problem.
>
> That didn't work, but this did (also in package.rb, zipped_stream):
>
> def zipped_stream(entry)
> # if Zlib::ZLIB_VERSION < '1.2.1'
> # zis = Zlib::GzipReader.new entry
> # dis = zis.read
> # is = StringIO.new(dis)
> # else
> is = Zlib::GzipReader.new entry
> # end
> #ensure
> # zis.finish if zis
> end
>
> BTW, ruby -e 'require "zlib"; p Zlib::ZLIB_VERSION' says
> "1.1.4"
>
> Thanks for pointing me in the right direction. Anything else you'd
> like to know to find a definitive fix for this?
>
> Clifford Heath.

Glad you're up and running. I wonder if the problem has something to do
with using a version of zlib to unzip a file that is older than the
version is was zipped with? Ruby 1.8.2, for which this RMagick gem was
built, has ZLIB::VERSION 1.2.1.

Clifford Heath

6/2/2006 1:33:00 AM

0

Tim Hunter wrote:
> Glad you're up and running.

Not quite. After changing "require 'RMagick'" to
require 'rubygems'
require_gem 'RMagick-win32'

(it's a shame that rubygems can't just extend 'require')...
I get a dialog saying "ruby.exe - Unable to locate Component" and
"This application has failed to start because libbz2.dll was not found".
The gem requires this DLL but doesn't provide it. Should it?

I can obviously update my Ruby version, except that this is the
version that we use in our standard build environment.

> I wonder if the problem has something to do
> with using a version of zlib to unzip a file that is older than the
> version is was zipped with? Ruby 1.8.2, for which this RMagick gem was
> built, has ZLIB::VERSION 1.2.1.

Again, it's probably a Ruby version issue. However we can't always
expect everyone to have the most recent version, we should be careful
with forwards and backwards compatibility... I've had these kinds of
problems with Perl also, being stuck at an old version because we use
perl2exe, but the PPM repository doesn't bother keeping packages that
work with the old version... sigh.

Clifford Heath

6/2/2006 2:02:00 PM

0

Clifford Heath wrote:
> I can obviously update my Ruby version...

Which I've now done, and RMagick, and ImageMagick, and Gtk...
all 16 zip files of the various pieces, to wit:

atk-1.10.3.zip
freetype-2.1.10-bin.zip
freetype-2.1.10-dep.zip
gettext-0.14.5.zip
glib-2.10.3.zip
gtk+-2.8.18.zip
jpeg-6b-4-bin.zip
jpeg-6b-4-dep.zip
libiconv-1.9.1.bin.woe32.zip
libpng-1.2.8-bin.zip
libpng-1.2.8-dep.zip
pango-1.12.3.zip
ruby-gtk2-0.14.1-1-i386-msvcrt-1.zip
tiff-3.8.2-1-bin.zip
tiff-3.8.2-1-dep.zip
zlib123-dll.zip

.... and now Gtk2 won't start. Sigh. Sometimes open source is hard
to believe in. Sorry to whinge, but you've gotta wonder whether
folk test the stuff they publish.

Tim Hunter

6/3/2006 12:27:00 AM

0

Clifford Heath wrote:
> Tim Hunter wrote:
>> Glad you're up and running.
>
> Not quite. After changing "require 'RMagick'" to
> require 'rubygems'
> require_gem 'RMagick-win32'

My understanding is that "require_gem" is deprecated. All you need to do is

require 'rubygems'
require 'RMagick'

Actually I'm surprised you have to require rubygems at all. I thought
the One-Click Installer set that up for you?

>
> (it's a shame that rubygems can't just extend 'require')...
> I get a dialog saying "ruby.exe - Unable to locate Component" and
> "This application has failed to start because libbz2.dll was not found".
> The gem requires this DLL but doesn't provide it. Should it?
>

The gem supplies all the .dlls you need. This message usually occurs
when you try to use RMagick before running the postinstall.rb script.
See the install FAQ: http://rmagick.rubyforge.org/install-fa...

> I can obviously update my Ruby version, except that this is the
> version that we use in our standard build environment.
>
>> I wonder if the problem has something to do with using a version of
>> zlib to unzip a file that is older than the version is was zipped
>> with? Ruby 1.8.2, for which this RMagick gem was built, has
>> ZLIB::VERSION 1.2.1.
>
> Again, it's probably a Ruby version issue. However we can't always
> expect everyone to have the most recent version, we should be careful
> with forwards and backwards compatibility... I've had these kinds of
> problems with Perl also, being stuck at an old version because we use
> perl2exe, but the PPM repository doesn't bother keeping packages that
> work with the old version... sigh.

You have all my sympathies. The RMagick-win32 gem is built using the
header files for a specific version of Ruby, a specific version of
ImageMagick, and a compiler that matches the compiler used for the One
Click Installer.

In many ways the build-from-source folks on *ix, *BSD, and OS X have it
easier since they always get RMagick built to match their specific system.