# Zlib::BufError

**URL:** <https://www.ruby-forum.com/t/zlib-buferror/108326>\
**Category:** Radiant CMS\
**Created:** [July 2, 2007, 11:29am UTC](https://www.ruby-forum.com/t/zlib-buferror/108326 "2007-07-02T11:29:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sharon\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9de0a6/32.png) [@Sharon\_C](https://www.ruby-forum.com/u/Sharon_C)\
**Post date:** [July 2, 2007, 11:29am UTC](https://www.ruby-forum.com/t/zlib-buferror/108326/1 "2007-07-02T11:29:21Z")

</div>

I’m having a problem upgrading from 0.6.1 to 0.6.2 on my local (Windows  
XP) test machine. I have tried this on a couple of Windows machines and  
each time I get a (Zlib::BufError) buffer error.

On my local machine I have updated Ruby to version 1.8.6 and have  
updated Ruby Gems to 0.9.4. I have also tried a clean install of Ruby,  
Gems and Radiant on a newly formatted machine, but again get the buffer  
error.

Any help would be appreciated.

Thanks

Sharon

C:\>gem update radiant  
Updating installed gems…  
Attempting remote update of radiant  
ERROR: While executing gem … (Zlib::BufError)  
buffer error

This e-mail has been scanned for all viruses by MessageLabs.

---

<div class="post-metadata">

**Author:** ![Sharon\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9de0a6/32.png) [@Sharon\_C](https://www.ruby-forum.com/u/Sharon_C)\
**Post date:** [July 2, 2007, 3:03pm UTC](https://www.ruby-forum.com/t/zlib-buferror/108326/2 "2007-07-02T15:03:49Z")

</div>

There was some discussion of this problem on the Capistrano mailing  
list too. Apparently, it’s a bug in RubyGems. Here’s the fix, from  
Jamis:

* * *

P.S. If you are on a Windows machine, and you get Zlib errors trying  
to install the Capistrano gem, try this. Find the rubygems/package.rb  
file (wherever it happens to be in your Ruby installation), open it  
up, and find the zipped\_stream method. Then, replace it, wholesale,  
with the following:

## def zipped\_stream(entry) entry.read(10) # skip the gzip header zis = Zlib::Inflate.new(-Zlib::MAX\_WBITS) is = StringIO.new(zis.inflate(entry.read)) ensure zis.finish if zis end

Cheers,

Sean
