Installing or updating any gem fails with "(Zlib::DataError) incorrect header check"

wmb's Avatar


07 Nov, 2011 08:51 PM

I had a very frustrating weekend.. I was unable to install or update any gems.

Every attempt to install or update a gem produced:

ERROR:  While executing gem ... (Zlib::DataError)
incorrect header check.

After eliminating every conceivable cause and following several wild goose chases, I eventually discovered that the rubygem mirrors had been miscategorized and blocked by a corporate web filter. I added some debugging that allowed me to see the url's and the issue became apparent.

was being hijacked, and instead of rake-, it was getting html to the effect of:

Content blocked by your organization
Reason:    This Websense category is filtered: Blogs and Personal Sites.

So.. if you're having issues with gems, make sure the requests aren't being hijacked or magled by something..

It would also seem appropriate for gem to do some content verification before blindly sending to zlib. It would have been extremely helpful to know the returned content did not match the expected mime type, content length, and certainly didn't produce a correct hash.

  1. Nick Quaranto closed this discussion on 04 Aug, 2012 06:47 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac