Как упоминает @Roman, rubyzip в настоящее время не хватает чтения и записи объектов ввода-вывода (включая StringIO.new(s)
). Попробуйте вместо этого использовать zipruby , например:
gem install zipruby
require 'zipruby'
# Given a string in zip format, return a hash where
# each key is an zip archive entry name and each
# value is the un-zipped contents of the entry
def unzip(zipfile)
{}.tap do |h|
Zip::Archive.open_buffer(zipfile) do |archive|
archive.each {|entry| h[entry.name] = entry.read }
end
end
end