Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Patch Rubygems On Windows For ERROR: While Executing Gem ... (Zlib::BufError) While Gem Install

DZone's Guide to

Patch Rubygems On Windows For ERROR: While Executing Gem ... (Zlib::BufError) While Gem Install

·
Free Resource

# site_ruby\ruby1.8\rubygems.rb
  def self.gunzip(data)
    require 'stringio'
    require 'zlib'
    data = StringIO.new data

    # Zlib::GzipReader.new(data).read
    data.read(10) # skip the gzip header
    zis = Zlib::Inflate.new(-Zlib::MAX_WBITS)
    is = StringIO.new(zis.inflate(data.read))
  end
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}