Чтение файлов xml после распаковки с помощью rubyzip

 require 'active_support/core_ext'
 require 'open-uri'
 require 'zip/zip'


 zipfilename = open(url which returns a zip file with no of xml files inside)
 Zip::ZipFile.open(zipfilename) do |zipfile|
   zipfile.each do |entry|  
    xml = File.open(entry).read
    xml_to_hash = Hash.from_xml(xml)
   end
end

когда я печатаю, пытаюсь напечатать запись переменной, она появляется как файл _name.xml. Ошибка исходит от xml = File.open (запись ).read.

Ошибка:

test.rb:51:in `initialize': can't convert Zip::ZipEntry into String (TypeError)
from test.rb:51:in `open'
from test.rb:51:in `block (2 levels) in <main>'
0
задан Bijendra 6 July 2012 в 10:09
поделиться