can't convert Hash into String(TypeError) #6

timchen86 opened this Issue Dec 26, 2012 · 1 comment


None yet

2 participants


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.

harrigan commented Jan 4, 2013

Can you try it with Ruby 1.9?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment