gpt4 book ai didi

ruby-on-rails - Rails - 使用 ruby​​gems 安装电子表格 gem 时出错

转载 作者:行者123 更新时间:2023-12-04 05:43:38 24 4
gpt4 key购买 nike

我希望能够处理 Rails 中的 excel 电子表格。
所以我正在使用 spreadsheet图书馆。
但是,当我使用 ruby​​gems 安装电子表格时,出现异常:

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 :

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/也很有用。

关于ruby-on-rails - Rails - 使用 ruby​​gems 安装电子表格 gem 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10969144/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com