From: sto.mar@... Date: 2013-07-02T22:51:19+09:00 Subject: Re: Error with JSON#parse Am 02.07.2013 10:10, schrieb Love U Ruby: > Josh Cheek wrote in post #1114121: > >> require 'json' >> require 'yaml' >> >> ruby = {:value => [ {"a" => nil, "b" => nil, "c" => 0}]} >> >> JSON.dump ruby # => "{\"value\":[{\"a\":null,\"b\":null,\"c\":0}]}" >> YAML.dump ruby # => "---\n:value:\n- a: \n b: \n c: 0\n" > > > Actually I wanted the output `{:value => [ {"a" => nil, "b" => nil, "c" > => 0}]}`from "{:value => [ {"a" => nil, "b" => nil, "c" => 0}]}" Please reread the previous answers.... Did you do that? No? Then do it now.... The point is, you feed strings that are neither valid JSON nor valid YAML into the JSON / YAML parser. What do you expect? That's like putting buttons into a vending machine. Josh was trying to show you what you should *instead* feed into the parser, to get what you want. BTW: JSON.parse is for parsing JSON. Not for getting some output. Regards, Marcus --