2

gem 'roo' が含まれているため、xls ファイルから情報を取得する必要があります。ファイルを読み取ろうとすると、エラーが発生します。

このエラーの修正にご協力ください!

私のコード:

require 'roo'
require 'spreadsheet'
require 'open-uri'

x = Roo::Excel.new("http://EXAMPLE.COM/EXAMPLE.xls")
x.cell 31,'F'

RuntimeError: /home/hender/.rvm/gems/ruby-2.1.2/gems/spreadsheet-0.9.7/lib/spreadsheet/excel/reader.rb:75:in からの不明なコードページ 0x906c

block in encoding' from /home/hender/.rvm/gems/ruby-2.1.2/gems/spreadsheet-0.9.7/lib/spreadsheet/excel/reader.rb:74:in fetch' from /home/hender/.rvm/gems/ruby-2.1.2/gems/spreadsheet-0.9.7/lib/spreadsheet/excel/reader.rb:74:in encoding' from /home/hender/.rvm/gems/ruby-2.1.2/gems/spreadsheet-0.9.7/lib/spreadsheet/excel/reader.rb:211:in read_codepage' from /home/hender/.rvm /gems/ruby-2.1.2/gems/spreadsheet-0.9.7/lib/spreadsheet/excel/reader.rb:821:in read_workbook' from /home/hender/.rvm/gems/ruby-2.1.2/gems/spreadsheet-0.9.7/lib/spreadsheet/excel/reader.rb:135:in read' from /home/hender/.rvm/gems/ruby-2.1.2/gems /spreadsheet-0.9.7/lib/spreadsheet/excel/workbook.rb:32:in open' from /home/hender/.rvm/gems/ruby-2.1.2/gems/spreadsheet-0.9.7/lib/spreadsheet.rb:63:in open' from /home/hender/.rvm/gems/ruby-2.1.2/gems/spreadsheet-0.9.7/lib/spreadsheet .rb:69:/home/hender/.rvm/gems/ruby-2.1.2/gems/roo-1.13.2/lib/roo/base.rb:565: /open' from /home/hender/.rvm/gems/ruby-2.1.2/gems/roo-1.13.2/lib/roo/excel.rb:40:in からの mktmpdir からの初期化のブロック内 block in make_tmpdir' from /home/hender/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tmpdir.rb:88:in home/hender/.rvm/gems/ruby-2.1.2/gems/roo-1.13.2/lib/roo/base.rb:564:in make_tmpdir' from /home/hender/.rvm/gems/ruby-2.1.2/gems/roo-1.13.2/lib/roo/excel.rb:31:in initialize' から /home/hender/helloapp/app/models/mode. rb:26: new' from /home/hender/helloapp/app/models/mode.rb:26:inこんにちは'
... 2 レベル ... /home/hender/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/commands/console.rb:9:in start' from /home/hender/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:69:in console から / からhome/hender/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:40:in run_command!' from /home/hender/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/commands.rb:17:in ' from /home/hender/.rvm/gems/ruby- 2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247: require' from /home/hender/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in/home/hender/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1 からの require のブロック内。 1/lib/active_support/dependencies.rb:232: load_dependency' from /home/hender/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in/home/hender/helloapp/bin/rails からの「require」:8: <top (required)>' from /home/hender/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:241:in/home/hender/.rvm/gems/ruby-2.1.2/gems からの「読み込み」 /activesupport-4.1.1/lib/active_support/dependencies.rb:241:inblock in load' from /home/hender/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in/home/hender/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:241 からの「load_dependency」: /home/hender/.rvm/rubies からload' from /home/hender/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in の「require」で/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in require' from -e:1:in'2.1.2 :004 > ^C 2.1.2 :004 >##

4

0 に答える 0