Вот код, который я создал, посмотрев на rubyzip internal.
level = Zlib::BEST_COMPRESSION
Zip::ZipOutputStream.open(zip_file) do |zip|
Dir.glob("**/*") do |filename|
entry = Zip::ZipEntry.new("", filename)
entry.gather_fileinfo_from_srcpath(filename)
zip.put_next_entry(entry, nil, nil, Zip::ZipEntry::DEFLATED, level)
entry.get_input_stream { |is| IOExtras.copy_stream(zip, is) }
end
end