什么可能解释了“无效存储的块长度”错误?

问题描述 投票:0回答:1
我正在使用Ruby 1.9.3p194在Vagrant虚拟盒中的基本Ubuntu Lucid32图像上运行带有Ruby 1.9.3p194的轨道应用程序。虚拟盒在豹子上运行,以达到价值。我正在尝试在应用程序中使用Rubyzip来解压缩邮政编码-

2009_da_lmp.zip

。直接从Rubyzip存储库中的示例中使用代码,我可以确认可以列出存档文件内容:

#f is the absolute path to 2009_da_lmp.zip (string) Zip::ZipFile.open(f) { |zf| zf.entries[0] } => 20090101_da_lmp.csv #that is indeed a file in the archive.
使用存储库中的示例中的更多代码,我尝试在存档中获取一个实际文件:

Zip::ZipInputStream.open(f) { |zis| entry = zis.get_next_entry print "first line of '#{entry.name}' (#{entry.size} bytes: ) " puts "'#{zis.gets.chomp}'" } => first line of '20090101_da_lmp.csv' (826610 bytes: ) Zlib::DataError: invalid stored block lengths #and a long stack trace I can provide #if that might help
MacOS解压缩实用程序解开档案罚款。我想知道这是否是某种编码相关的东西(我的语言环境设置为en_us.utf-8,因为要在dev中使用postgresql少痛苦),但是我不知道如何判断是否是这种情况。我找不到有关可能导致此错误的任何信息。
    

ruby zlib rubyzip
1个回答
13
投票

© www.soinside.com 2019 - 2024. All rights reserved.