我正在使用Ruby on Rails。我有一個散列像下面Json解析哈希解析錯誤
{"attachment"=>"{:output_dir=>\"/home/mypath/\", :process_hash=>\"8b9d9c51\", :type=>\"pdf\", :processed_dir=>\"/513/9a1/88a\", :pdf=>\"/system/path/a3ae1194f76d737b6cfb141fa0fde17f78f2e94e.pdf\", :slides_count=>4, :meta=>{:swfs=>\"{/system/path/88a/8b9d9c51[*,0].swf,4}\", :pngs=>\"/system/path/8b9d9c51{page}.png\", :json=>\"/system/path/8b9d9c51.js\"}}"
在我的代碼有
JSON.parse(PARAMS [:附件])
會拋出我一個錯誤作爲
JSON: :ParserError(757:'{:output_dir =>「/ home/path」,:process_hash =>「8b9d9c51」,:type =>「pdf」,:processed_dir =>「/ 513/9a1/88a」)上的意外標記, :pdf =>「/ system/path/a3ae1194f76d737b6cfb141fa0fde17f78f2e94e.pdf」,::slides_count => 4,:meta => {:swfs =>「{/ system/path /8b9d9c51[*,0].swf,4}「,::pngs =>」/ system/path/8b9d9c51 {page} .png「,::json =>」/ system/path/8b9d9c51.js「}}') :
建議我如何解決這個問題。