On the system having issues, find ExecJS’s runtimes.rb file which will present in execjs gem. Make a copy of the found file for backup. Open the original runtimes.rb for editing. Find the section that starts with the line
JScript = ExternalRuntime.new(
// other Options
)
and replaced it with
JScript = ExternalRuntime.new(
:name => "JScript",
:command => "cscript //E:jscript //Nologo",
:runner_path => ExecJS.root + "/support/jscript_runner.js",
:encoding => 'UTF-8' # CScript with //U returns UTF-16LE
)
and the problem will resolved