rails 在Win8 下出现ExecJS::RuntimeError
文章摘自http://ruby-china.org/topics/7523
execjs现在已经能认到Windows自带的CScript了所以windows下无需再装therubyracer和nodejs之类的JSRuntime
但是Win8下CScript默认接受js编码是UTF-8,而之前的CScript接受的是ASCII/GBK,或者用//U参数后接受UTF-16,解决方法是
修改execjsgem路径下execjs\runtimes.rb
JScript = ExternalRuntime.new( :name => "JScript", :command => "cscript //E:jscript //Nologo //U", :runner_path => ExecJS.root + "/support/jscript_runner.js", :encoding => 'UTF-16LE' )
改成
JScript = ExternalRuntime.new( :name => "JScript", :command => "cscript //E:jscript //Nologo", :runner_path => ExecJS.root + "/support/jscript_runner.js", :encoding => 'UTF-8' )
相关推荐
wl00 2020-10-28
EricNet 2020-07-05
EricNet 2020-05-27
何志文 2020-05-11
JOO 2020-04-26
happyfreeangel 2020-04-09
Poisedflw 2020-03-23
yangliuhbhd 2020-03-06
Ben的程序员生涯 2013-06-01
chenshuixian 2013-06-01
wes0 2014-05-31
mrice00 2019-12-20
EricNet 2019-12-11
89304896 2019-12-08
lihaoningxia 2013-07-09
userguanguan 2015-03-16