ruby / csv

CSV Reading and Writing
https://ruby.github.io/csv/
BSD 2-Clause "Simplified" License
178 stars 114 forks source link

csv2json error when accessing csv in Ruby 3.0 #223

Closed rtimblin closed 3 years ago

rtimblin commented 3 years ago

Throws the below error when built in Ruby 3.0 but works fine with Ruby 2.7.4. Problem also exists when csv2json is run independently

TS-MAC16:csvconvert ats-tom$ bundle exec csvconvert easyway sample_easyway.csv test.json
bundler: failed to load command: csvconvert (/Users/ats-tom/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/bin/csvconvert)
/Users/ats-tom/.rbenv/versions/3.0.0/lib/ruby/3.0.0/csv.rb:1732:in `initialize': wrong number of arguments (given 2, expected 1) (ArgumentError)
    from /Users/ats-tom/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/csv2json-0.3.0/lib/csv2json.rb:19:in `new'
    from /Users/ats-tom/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/csv2json-0.3.0/lib/.....
olleolleolle commented 3 years ago

Keyword arguments in csv2json gem seem not to be 3.0-ready, this is a csv2json issue which can be fixed there.

hsbt commented 3 years ago

It's problem with csv2json, not csv.

rtimblin commented 3 years ago

Thank you. I'll look there.

On Sat, Oct 23, 2021 at 5:17 AM Hiroshi SHIBATA @.***> wrote:

It's problem with csv2json, not csv.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ruby/csv/issues/223#issuecomment-950122401, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUA3FARJNVQOITQSDUDX34DUIJ4SBANCNFSM5GRWPNWA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.