time = Time.parse(@year)
puts "#{time.strftime("%B_%Y")}"
file_path = file_access
CSV.foreach(file_path[0], headers: true, header_converters: :symbol, skip_blanks: true) do|row|
    day = Time.parse(get_date(row)) #Error line
    max = row[:max_temperaturec].to_i
    min = row[:min_temperaturec].to_i
    unless(min.zero? || max.zero?)
      print "#{day.strftime("%d")} "
      unless min.zero?
        min.times{ print '+'.blue }
      end
      unless max.zero?
        min.times{ print '+'.red }
      end
      puts "#{min}C.-.#{max}C"
    end
  end

Traceback (most recent call last): 17: from WeatherMan_CompleteProject.rb:20:in `'

    16: from /home/dev/rubyprograms/WeatherMan_Main_CLASS_Complate.rb:155:in `task4'
    15: from /usr/lib/ruby/2.7.0/csv.rb:510:in `foreach'
    14: from /usr/lib/ruby/2.7.0/csv.rb:658:in `open'
    13: from /usr/lib/ruby/2.7.0/csv.rb:511:in `block in foreach'
    12: from /usr/lib/ruby/2.7.0/csv.rb:1280:in `each'
    11: from /usr/lib/ruby/2.7.0/csv.rb:1280:in `each'
    10: from /usr/lib/ruby/2.7.0/csv/parser.rb:336:in `parse'
     9: from /usr/lib/ruby/2.7.0/csv/parser.rb:823:in `parse_quotable_loose'
     8: from /usr/lib/ruby/2.7.0/csv/parser.rb:49:in `each_line'
     7: from /usr/lib/ruby/2.7.0/csv/parser.rb:49:in `each_line'
     6: from /usr/lib/ruby/2.7.0/csv/parser.rb:52:in `block in each_line'
     5: from /usr/lib/ruby/2.7.0/csv/parser.rb:871:in `block in parse_quotable_loose'
     4: from /usr/lib/ruby/2.7.0/csv/parser.rb:1122:in `emit_row'
     3: from /home/dev/rubyprograms/WeatherMan_Main_CLASS_Complate.rb:156:in `block in task4'
     2: from /usr/lib/ruby/2.7.0/time.rb:375:in `parse'
     1: from /usr/lib/ruby/2.7.0/time.rb:266:in `make_time'

/usr/lib/ruby/2.7.0/time.rb:266:in `local': argument out of range (ArgumentError)

0

There are 0 best solutions below