Zipping files contained in a dir (rubyzip)

hey so I'm trying to zip all the files contained in a directory
(RubyZip). heres what I have:

      def bundle
           #create the ZIPfile with the title of (:id).zip
      bundle_filename = "public/attachments/#{}/#{}.zip"

           #open the ZIPfile in order to add items in, Zip::ZipFile::CREATE) {
         Dir.foreach("public/attachments/#{}") do |item|
         t =
         zipfile.add(t, "public/attachments/#{}")

          #change permissions on ZIPfile
       File.chmod(0644, bundle_filename)

This successfully executes the first line and creates the zip file with
the correct name but it is not adding to the zip file all the files
contained in that directory. Any Ideas?