csv2json icon indicating copy to clipboard operation
csv2json copied to clipboard

can't convert Hash into String(TypeError)

Open timchen86 opened this issue 12 years ago • 1 comments

Hi, I got an error, any idea?

$ json2csv 1.json /usr/lib/ruby/1.8/csv.rb:326:in initialize': can't convert Hash into String (TypeError) from /usr/lib/ruby/1.8/csv.rb:326:inopen' from /usr/lib/ruby/1.8/csv.rb:326:in open_writer' from /usr/lib/ruby/1.8/csv.rb:111:ingenerate' from /usr/local/bin/../lib/json2csv.rb:15:in `parse' from /usr/local/bin/json2csv:69

the json file is:

[ { "thumbwidth": 75, "imgsrc": "paris_01.jpg", "thumbsrc": "paris_01.jpg", "height": 262, "imgpath": "images/", "thumbheight": 56, "thumbpath": "thumbnails/", "width": 350 }, { "thumbwidth": 75, "imgsrc": "paris_02.jpg", "thumbsrc": "paris_02.jpg", "height": 350, "imgpath": "images/", "thumbheight": 56, "thumbpath": "thumbnails/", "width": 262 } ]

Also it seems the json2csv is not in the Ruby gem package.

timchen86 avatar Dec 26 '12 09:12 timchen86

Can you try it with Ruby 1.9?

harrigan avatar Jan 04 '13 11:01 harrigan