I'm running RAILS_ENV=production bundle exec rake assets:precompile
and getting this error
...somefile.js
ExecJS::ProgramError: Unexpected token: operator (-) (line: 3, col: 9, pos: 11)
This is the content of that line:
var color-green="#27cebc";
I guess the problem is because the variable name includes a -
. However using the same ruby version on local computer with same command, it's able to process correctly without the error:
On my local computer:
RAILS_ENV=production bundle exec rake assets:precompile`
And it was able to process the offending file without problems, and generated this file:
public/assets/js/some=file-68c9a5f2e1f2216c5d3d2b9fcd7741155113425f7f46f18187ad5b98e1a11092.js
$ ruby -v
ruby 2.2.1p85
$ gem list | grep js
execjs (2.5.2)
I tried commenting the line out and it process all the files succesfully, but I dont understand why on local it works with that line, and in the server doesnt.