From: "Y. NOBUOKA" Date: 2011-03-09T21:14:24+09:00 Subject: Re: Most simple usage of zlib or pr-zlib Hi, > ruby-1.9.2-p136 :009 > data = StringIO.new( open( 'test.zip', 'r' ).read ) I see that you want to read a ZIP format file, "test.zip". Right? > ruby-1.9.2-p136 :010 > Zlib::GzipReader.new(data).read > Zlib::GzipFile::Error: not in gzip format However, you used Zlib::GzipReader. This class is used for not zip format, but gzip format [1], so that error occurred. One way to unzip a file is to use zipruby gem [2]. Please try it. [1] http://www.ruby-doc.org/stdlib/libdoc/zlib/rdoc/classes/Zlib/GzipReader.html [2] https://rubygems.org/search?utf8=%E2%9C%93&query=zipruby Regards, -- NOBUOKA Yu http://www.vividcode.info/