Got this error on production but can\'t figure out where the problem is. Same request works fine on local development. But fail on production. I\'m building API for mobile c
According Rails 4.1 release note:
Removed support for the encode_json hook used for encoding custom objects into JSON. This feature has been extracted into the activesupport-json_encoder gem. (Related Pull Request / More Details)
Because activesupport doesn't encoding invalid code anymore. Add activesupport-json_encoder gem to Gemfile fix this issue.
Just adding if it can be of help to someone who is trying to find the solution to the error , while trying to write .jpg or any image files.
"wb" instead of "w" in
File.open(filename,'wb')
has solved this issue for me.