Rails - 使用rubygems获取安装电子表格gem的错误 [英] Rails - getting errors installing the spreadsheet gem using rubygems

查看:122
本文介绍了Rails - 使用rubygems获取安装电子表格gem的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想能够在rails中处理excel spreadhseets。

所以我使用电子表格库。

但是,当我使用rubygems安装电子表格时,出现一个异常:

I want to be able to deal with excel spreadhseets in rails.
So I am using the spreadsheet library.
However, when I use rubygems to install the spreadsheet, I get an exception:

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中,我写了代码:

then in my doSomethingController, i wrote the code:

require 'spreadsheet'

但服务器返回错误

but the server returns the error

cannot load such file -- spreadsheet

可以你帮我弄清楚发生了什么事情,我该如何解决这个异常问题。

can you help me figure out what has happened and how can i fix the exception

我的环境:

My environments:

ruby 1.9.3
rubygem 1.8.16


推荐答案

检查您的宝石:

Check your gems:

gem list

检查是否安装了一个:

Check for that one being installed:

gem list | grep spreadsheet 

按照 http://rubygems.org/gems/spreadsheet ,其中还讨论了开发相关性:

Follow the instructions for use at http://rubygems.org/gems/spreadsheet which also talks about Development Dependencies:

hoe ~> 2.13   
rdoc ~> 3.10  

http://spreadsheet.rubyforge.org/files/GUIDE_txt.html

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

The wiki - http://spreadsheet.ch/ is also useful.

这篇关于Rails - 使用rubygems获取安装电子表格gem的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆