轨道 - 使用红宝石安装电子表格宝石时出错



我希望能够在rails中处理excel spreadhseets。
所以我正在使用spreadsheet库。
但是,当我使用红宝石安装电子表格时,我得到一个异常:

Successfully installed spreadsheet-0.7.1
1 gem installed
Installing ri documentation for spreadsheet-0.7.1...
unable to convert "xE2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to GBK
for lib/spreadsheet/excel/internals.rb, skipping
unable to convert "xE2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to GBK
for lib/spreadsheet/excel/reader/biff8.rb, skipping
unable to convert "xE2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to GBK
for lib/spreadsheet/excel/reader.rb, skipping
unable to convert "xE2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to GBK
for lib/spreadsheet/excel/writer/biff8.rb, skipping
unable to convert "xE2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to GBK
for lib/spreadsheet/excel/writer/format.rb, skipping
unable to convert "xE2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to GBK
for lib/spreadsheet/excel/writer/n_worksheet.rb, skipping
unable to convert "xE2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to GBK
for lib/spreadsheet/excel/writer/workbook.rb, skipping
unable to convert "xE2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to GBK
for lib/spreadsheet/excel/writer/worksheet.rb, skipping
Installing RDoc documentation for spreadsheet-0.7.1...
unable to convert "xE2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to GBK
for lib/spreadsheet/excel/internals.rb, skipping
unable to convert "xE2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to GBK
for lib/spreadsheet/excel/reader/biff8.rb, skipping
unable to convert "xE2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to GBK
for lib/spreadsheet/excel/reader.rb, skipping
unable to convert "xE2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to GBK
for lib/spreadsheet/excel/writer/biff8.rb, skipping
unable to convert "xE2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to GBK
for lib/spreadsheet/excel/writer/format.rb, skipping
unable to convert "xE2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to GBK
for lib/spreadsheet/excel/writer/n_worksheet.rb, skipping
unable to convert "xE2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to GBK
for lib/spreadsheet/excel/writer/workbook.rb, skipping
unable to convert "xE2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to GBK
for lib/spreadsheet/excel/writer/worksheet.rb, skipping`

然后在我的doSomethingController中,我编写了代码:

require 'spreadsheet'

但服务器返回错误

cannot load such file -- spreadsheet

你能帮我弄清楚发生了什么以及如何解决异常吗

我的环境:

ruby 1.9.3
rubygem 1.8.16

检查你的宝石:

gem list

检查正在安装的那个:

gem list | grep spreadsheet 

按照 http://rubygems.org/gems/spreadsheet 中的使用说明进行操作,其中还讨论了开发依赖项:

hoe ~> 2.13   
rdoc ~> 3.10  

有一个很棒的"入门"指南 http://spreadsheet.rubyforge.org/files/GUIDE_txt.html

维基 - http://spreadsheet.ch/也很有用。

相关内容

最新更新