在使用 excel 工作表时在 ruby 中,我使用的是“roo”gem。它适用于与我的系统关联的本地文件。但是当我从互联网上下载一个新的 excel 文件并用“roo”打开它时会抛出类似的错误
Ruby193/lib/ruby/gems/1.9.1/gems/roo-2.3.2/lib/roo/excelx.rb:364:inblock in extract_sheets_in_order': undefined method 'extract' for nil:NilClass (NoMethodError)
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/roo-2.3.2/lib/roo/excelx.rb:358:in 'each'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/roo-2.3.2/lib/roo/excelx.rb:358:in 'each_with_index'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/roo-2.3.2/lib/roo/excelx.rb:358:in 'extract_sheets_in_order'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/roo-2.3.2/lib/roo/excelx.rb:400:in 'process_zipfile_entries'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/roo-2.3.2/lib/roo/excelx.rb:379:in 'process_zipfile'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/roo-2.3.2/lib/roo/excelx.rb:48:in 'initialize'
from excel1.rb:5:in 'new'
from excel1.rb:5:in '<main>
roo 版本 => 2.3.2 操作系统 => Windows 7