阅读背景:

为nil:NilClass (NoMethodError)在ruby中的未定义方法[]…为什么?

来源:互联网 

Here's my code:

这是我的代码:

begin
     items = CSV.read('somefile.csv')
     linesAmount = CSV.readlines('somefile.csv').size
     counter = 1
     while linesAmount >= counter do
       fullrow = items[counter]
       firstitem = fullrow[0] #This is the line that my code doesn't like.
       puts firstitem
       counter = counter + 1

     end


end
begin
     items =



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: