This may be related to JSON error with coffeescript & Rails asset pipeline
I'm working on an app in Rails 4. I have an asset called tasks.js.coffee. Until recently everything was fine. This morning I wanted to make a change, and Rails throws "only generation of JSON objects or arrays allowed".
It seems that any change is sufficient to throw the error, even removing a blank line, or changing a single character in a string. When I revert changes it works again.
I'm assuming some gems got updated yesterday when I did a bundle update, causing this problem.
Did anybody else see it? Does anyone know what causes this problem, and how to fix it?
Update your ruby version to 2.0.0.
I had to set the execjs version in the Gemfile to 1.4.0: gem 'execjs' '1.4.0'. The recent update to 2.0.0 seems to be the one causing the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With