ExecJS::RuntimeUnavailable in Rails 4.1.4

时光怂恿深爱的人放手 提交于 2019-12-05 15:36:17

Ubuntu Users

I'm on Ubuntu 11.04 and had similar issues. Installing Node.js fixed it.

As of Ubuntu 13.04 x64 you only need to run:

sudo apt-get install nodejs

This will solve the problem. CentOS/RedHat Users

sudo yum install nodejs

A quick and easy solution is to uncomment this line in Gemfile and run bundle install again

gem 'therubyracer',  platforms: :ruby
Justin

This has been answered in great detail by @KevinP here.

Following the link above, you need to go into Execjs's runtimes.rb and change that line specified in his answer. After that, restart your server and it should start working.

The block that needs to be changed looks like this:

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
)

^ Credit to Kevin P.

I also answered this question a few days go here. https://stackoverflow.com/a/24591983/2456549

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!