本文介绍了Rails - 找不到 JavaScript 运行时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在本地机器上使用 rails 3.1.0.rc4
创建了一个新的 Rails 项目,但是当我尝试启动服务器时,我得到:找不到 JavaScript 运行时.有关可用运行时的列表,请参阅此处.(ExecJS::RuntimeUnavailable
)
I created a new Rails project using rails 3.1.0.rc4
on my local machine but when I try to start the server I get:Could not find a JavaScript runtime. See here for a list of available runtimes. (ExecJS::RuntimeUnavailable
)
注意:这与 Heroku 无关.
Note: This is not about Heroku.
推荐答案
安装nodejs等javascript运行库解决这个问题
要在ubuntu上安装nodejs,可以在终端输入以下命令:
Installing a javascript runtime library such as nodejs solves this
To install nodejs on ubuntu, you can type the following command in the terminal:
sudo apt-get install nodejs
要使用 yum 在系统上安装 nodejs,请在终端中键入以下内容:
To install nodejs on systems using yum, type the following in the terminal:
yum -y install nodejs
这篇关于Rails - 找不到 JavaScript 运行时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!