Closed faucct closed 7 years ago
We know that there is a problem with mulit-json. There is a PR ( #339 ) which will remove multi-json. Can you uninstall multi-json? If multi-json is not installed, it should work. If you cannot uninstall multi-json because another project needs it, then use a custom gemset. This of course won't help if you need multi-json in the very same project.
Actually my PR https://github.com/ohler55/oj/pull/320 in oj
was accepted, so it makes the issue fixed. Closing.
Hello, I have noticed that this code fails with
JSON::ParserError
though it should have fallen back to reading from file:I have dug deeper and found that the explanation of that. When I require your gem, it requires
multi_json
and makes it use its default adapter. This makes it cacheJSON::ParserError
here. After that I requireoj_mimic_json
which overridesJSON::ParserError
here. Now whenJSON.parse
throws an error,MultiJSON.load
fails to wrap it insideMultiJSON::ParseError
and as a result you fail to rescue it here and don't even try to read the file. I am not sure which gem is most guilty here, so I will mention this issue there too. The problem can be reproduced without your gem: