I am using archive-zip gem for unzipping zip files inside ruby code to be used in a scheduler task. Some times it is working fine but few times i am getting "undefined method `new' for nil:NilClass" error while unzipping in Archive:zip line.
The code snippet is
require 'archive/zip'
Dir.foreach("#{Rails.public_path}/#{zip_folder}/") do |item|
Archive::Zip.extract("#{Rails.public_path}/#{zip_folder}/"+ item, "#{Rails.public_path}/#{zip_folder}/inspected/", :password => 'password')
end
Please help me.
Thanks in advance.