나는 루비에서 엑셀 파일을 읽고 데이터를 가져 와서 그것을 mysql 데이터베이스에 삽입하려고한다. 나는 spreadsheet :: excel과 mysql gem을 사용하고있다. 내가 읽기 위해 파일을 열도록 스프레드 시트 보석을 사용할 수 있도록 보일 수 없다 어떤 이유로 ...이 내가 스크립트를 실행할 때 내가 이상한 오류가 내 코드루비 엑셀 리더, 스프레드 시트 젬
require 'rubygems'
require 'spreadsheet'
require 'mysql'
Spreadsheet.client_encoding = 'UTF-8'
book = Spreadsheet.open '/home/data/teams.xlsb'
b1 = book.worksheet('team1')
입니다
/usr/local/lib/ruby/gems/1.8/gems/ruby-ole-1.2.11.1/lib/ole/storage/base.rb:376:in `validate!': OLE2 signature is invalid (Ole::Storage::FormatError)
from /usr/local/lib/ruby/gems/1.8/gems/ruby-ole-1.2.11.1/lib/ole/storage/base.rb:368:in `initialize'
from /usr/local/lib/ruby/gems/1.8/gems/ruby-ole-1.2.11.1/lib/ole/storage/base.rb:110:in `new'
from /usr/local/lib/ruby/gems/1.8/gems/ruby-ole-1.2.11.1/lib/ole/storage/base.rb:110:in `load'
from /usr/local/lib/ruby/gems/1.8/gems/ruby-ole-1.2.11.1/lib/ole/storage/base.rb:77:in `initialize'
from /usr/local/lib/ruby/gems/1.8/gems/ruby-ole-1.2.11.1/lib/ole/storage/base.rb:83:in `new'
from /usr/local/lib/ruby/gems/1.8/gems/ruby-ole-1.2.11.1/lib/ole/storage/base.rb:83:in `open'
from /usr/local/lib/ruby/gems/1.8/gems/spreadsheet-0.6.5.8/lib/spreadsheet/excel/reader.rb:1144:in `setup'
from /usr/local/lib/ruby/gems/1.8/gems/spreadsheet-0.6.5.8/lib/spreadsheet/excel/reader.rb:121:in `read'
from /usr/local/lib/ruby/gems/1.8/gems/spreadsheet-0.6.5.8/lib/spreadsheet/excel/workbook.rb:32:in `open'
from /usr/local/lib/ruby/gems/1.8/gems/spreadsheet-0.6.5.8/lib/spreadsheet.rb:62:in `open'
from /usr/local/lib/ruby/gems/1.8/gems/spreadsheet-0.6.5.8/lib/spreadsheet.rb:68:in `open'
from sizes_importer2.rb:7
이 보석이 .xlsb 파일을 지원하지 못할 수도 있습니다. 나는 이것이 사실인지 아닌지는 모르지만, 누군가가 내게 어떻게 나아갈 지 말해 줄 수 있습니까? 아니면 뭔가 다른 것이 있다면요? 나는 완전히 잃어 버렸고이 오류에 대한 도움을 주실 것입니다. 고마워요
파일을 2003 xls로 변환해야했습니다. – Crobos