Skip to content

CsvHash.foreach fails on Ruby 3.x #12

@sroller

Description

@sroller

this works on Ruby 2.7.5, but fails on 3.0.x and 3.1.x

require 'csvreader'

CsvHash.foreach("beer.csv", {header_converters: :symbol}) do |row|
  puts row
end

csvreader v1.2.5

Platforms: Windows 10, WSL, Ubuntu, Rasbian

error message:

user@JUPITER:/mnt/d/src/Ruby/csv$ ruby csv_test.rb
/home/user/.rvm/gems/ruby-3.1.0/gems/csvreader-1.2.5/lib/csvreader/reader_hash.rb:58:in `foreach': wrong number of arguments (given 2, expected 1) (ArgumentError)
        from csv_test.rb:3:in `<main>'

Any advise what to change?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions