title: Using rubyzip to add files and nested directories to a zipoutputstream
body: <p>I'm struggling with getting rubyzip to append directories to a zipoutputstream. (I want the output stream so I can send it from a rails controller). My code follows this example:</p>
  
  <p><a href="http://info.michael-simons.eu/2008/01/21/using-rubyzip-to-create-zip-files-on-the-fly/" rel="nofollow noreferrer">http://info.michael-simons.eu/2008/01/21/using-rubyzip-to-create-zip-files-on-the-fly/</a></p>
  
  <p>When modified to include directories in the list of files to add I get the following error:</p>
  
  <p></p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>After trying a number of solutions I had best success with zipruby which has a clean api and good examples: <a href="http://zipruby.rubyforge.org/" rel="nofollow noreferrer">http://zipruby.rubyforge.org/</a>.</p>