Zip::ZipFile.open "zip文件名.zip", Zip::ZipFile::CREATE do |zip| zip.add("zip包中的显示的文件名(或者文件路径)","要打包的文件(路径)") end
Zip::ZipFile.open "zip文件名.zip", Zip::ZipFile::CREATE do |zip| zip.add(Iconv.iconv("GBK//IGNORE", "UTF-8//IGNORE", "zip包中的显示的文件名或者文件路径"),"要打包的文件(路径)") end