I am using shell command to zip file in ruby. Then I am uploading the zipped file to server. when I use it in a loop like:
dump_files.each do |dump_file|
Open3.popen3("zip #{zip_file} #{dump_file}")
end
And upload, the last file in the dump_files array is not present in the uploaded zipfile but it present in the local file.
I think it happens because of the time delay to zip the file. How can I delay my ruby execution till the zip command execution complete?
sleep 10and you will see."zip ..". You should just runzip ....