Why do I get NilClass error on this simple string operator?
In the read_hdr method below, I'm trying to use a print statement for
debugging:
def read_hdr(arr)
# store the marker names in the header
arr.each_with_index { |val,idx|
@hdr_arry[idx] = val
puts "hdr_arry[idx] = #{@hdr_arry[idx]}"
}
.. but I get the following error on the last line:
/home/caseyr/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/csv.rb:1727:in
`<<': undefined method `+' for nil:NilClass (NoMethodError)
This is using ruby 1.9.3 using rvm. The variable arr is an array that is
the first line of data file that is being read using CSV class.
Any hints much appreciated...
No comments:
Post a Comment