ExecJS::RuntimeError on Windows trying to follow rubytutorial

后端 未结 13 1847
清歌不尽
清歌不尽 2020-11-22 07:27

UPDATE: Colin\'s suggestion of removing the line //= require_tree . has fixed the issue.

I have wasted over 2 days trying to follow every suggestion

相关标签:
13条回答
  • 2020-11-22 07:52

    I favoured the Learning route. It seems the problem stems from

    IO.popen(command, options) { |f| output = f.read }
    

    returning an empty string in execjs\external_runtine.rb (line 173 in version 1.4.0). This is why the error message contains no text. The changes suggested did not work for me. I changed UTF-16LE to UTF-8, but it still returned an empty string. I removed \\U from the command - this at least returned text, but it was in the wrong encoding - in the browser it displayed as Chinese characters.

    According to this MSDN blog post, using the //U flag and redirecting to a file causes cscript to return the result using UTF-16.

    And then, magically, it worked (@#%$&^@$%!!!?!?!) using command as "cscript //E:jscript //Nologo" and encoding as "UTF-8". Oh well.

    0 讨论(0)
提交回复
热议问题