0

我已经使用“sudo gem install spreadsheet”在 Mac OS X 10.7 中安装了电子表格。但是当我运行一个示例时,它无法成功运行。

/Users/dearkx/.rvm/gems/ruby-1.9.3-p0/gems/spreadsheet-0.7.1/lib/spreadsheet/excel/writer/workbook.rb:189: warning: assigned but unused variable - len
/Users/dearkx/.rvm/gems/ruby-1.9.3-p0/gems/spreadsheet-0.7.1/lib/spreadsheet/excel/writer/workbook.rb:527: warning: assigned but unused variable - bef
/Users/dearkx/.rvm/gems/ruby-1.9.3-p0/gems/spreadsheet-0.7.1/lib/spreadsheet/excel/writer/worksheet.rb:292: warning: assigned but unused variable - len
/Users/dearkx/.rvm/gems/ruby-1.9.3-p0/gems/spreadsheet-0.7.1/lib/spreadsheet/excel/writer/worksheet.rb:599: warning: assigned but unused variable - links
/Users/dearkx/.rvm/gems/ruby-1.9.3-p0/gems/ruby-ole-1.2.11.3/lib/ole/storage/base.rb:232: warning: assigned but unused variable - before
/Users/dearkx/.rvm/gems/ruby-1.9.3-p0/gems/ruby-ole-1.2.11.3/lib/ole/types/property_set.rb:36: warning: assigned but unused variable - map
/Users/dearkx/.rvm/gems/ruby-1.9.3-p0/gems/ruby-ole-1.2.11.3/lib/ole/storage/meta_data.rb:79: warning: assigned but unused variable - compobj_version
⋯⋯⋯⋯
⋯⋯⋯⋯
4

1 回答 1

0

它们只是警告,而不是错误。它们只是在 gem 中指出程序员不应该做的事情,但 Ruby 仍然会执行代码。

这些警告是在2010 年添加的,这可以解释为什么它没有出现在 Ruby 1.8.7 中。

于 2012-05-11T07:04:44.853 回答