rubyzip

xlsx compressed by rubyzip not readable by Excel

北城余情 提交于 2019-11-29 23:54:05
问题 I am working on writing code which can read/write Excel xlsx files. xlsx files are simply zip archives of several xml files, so in order to test out if I could write a file, I used a gem called rubyzip to unzip the xlsx file and then immediately zip it back up to a new archive, without modifying the data. When I do this, however, I cannot open the new excel file, it is said to be corrupted. Alternatively, if I use Mac OS X's Archive Utility (the native application to handle zip files), and I

Using rubyzip error - no such file to load — zip/zip

廉价感情. 提交于 2019-11-27 23:28:03
I know there is another thread on this subject but I still face this problem even after using all solutions. Is there any other way to generate zip files? Can i use Ubuntu system commands? I did gem install rubyzip I have require 'rubygems' require 'zip/zip' in my controller But i still get the same error - no such file to load -- zip/zip I tried with both ruby 1.8.7 and ruby 1.9.2 with rails 3.0.5 on Ubuntu Could you please help me? Thanks. I fixed this problem by specifying gem version 0.9.9 in Gemfile: gem 'rubyzip', "~> 0.9.9" Using rubyzip (1.0.0) caused an error. There's a note about