# Create a Zip with Kernel.system

**URL:** <https://www.ruby-forum.com/t/create-a-zip-with-kernel-system/174725>\
**Category:** Rails\
**Created:** [September 1, 2009, 8:32am UTC](https://www.ruby-forum.com/t/create-a-zip-with-kernel-system/174725 "2009-09-01T08:32:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Geoffroy\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f17d59/32.png) [@Geoffroy\_G](https://www.ruby-forum.com/u/Geoffroy_G)\
**Post date:** [September 1, 2009, 8:32am UTC](https://www.ruby-forum.com/t/create-a-zip-with-kernel-system/174725/1 "2009-09-01T08:32:25Z")

</div>

Hey,

I’m trying to create a zipfile containing a lots of pictures that  
where uploaded using attachement\_fu.  
I used rubyzip, and everything worked great until I used it to  
compress a lot of files, then it produced a RangeError (from an  
Array#pack call somewhere in rubyzip).  
So with a little irc help, I found out I could use a system call  
(something like: system(“zip -g zipfile file\_to\_add”) ) and it should  
work.  
It worked locally (mac ruby 1.8.6 rails 2.3.3), but not on my server  
(same but linux).  
But when invoking a ruby script (ruby zipper.rb), with a few dumy  
system calls it works.  
When logging the return value of the Kernel.system call, it returns  
nil.

I’m near banging my head against the wall, please help.

Geoff
