我使用了" sudo gem install电子表格"在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
⋯⋯⋯⋯
⋯⋯⋯⋯
答案 0 :(得分:0)
他们只是警告,而不是错误。它们只是在gem中指出程序员不应该做的事情,但Ruby仍然会执行代码。
这些警告已添加到2010中,这可能解释了为什么它没有出现在Ruby 1.8.7中。