following the documentation for rubyzip 2.3.2, I have this method:
def zip_files(zip_file_name, files)
Zip::File.open(zip_file_name, Zip::File::CREATE) do |zipfile|
files.each do |filename|
zipfile.add(filename, File.join('.', filename))
end
end
end
files = ["test.txt", "test2.txt"]
zip_files("testing.zip", files)
this produces an error: undefined method 'join' for Zip::File:Class (NoMethodError)
This does create a "testing.zip" file, but it is empty
the files live in the same directory and I've tested that with: puts files the files are returned