我使用Rails 3.1.0创建了一个新的Rails项目。rc4在我的本地机器上,但当我试图启动服务器时,我得到: 找不到JavaScript运行时。请参阅这里的可用运行时列表。(ExecJS:: RuntimeUnavailable)

注意:这不是关于Heroku的。


当前回答

Sudo apt-get安装nodejs不适合我。为了让它工作,我必须做以下事情:

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

希望这能帮助到和我有同样问题的人。

其他回答

Sudo apt-get安装nodejs不适合我。为了让它工作,我必须做以下事情:

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

希望这能帮助到和我有同样问题的人。

在CentOS 6.5上,以下操作对我来说是有效的:

sudo yum install -y nodejs

如果都失败了,你可以试试

# aptitude安装nodejs

作为根。您可以使用以下命令测试您的安装:

# node -v

如果你想安装NPM,请参考下面的链接。希望能有所帮助。

在宝石文件中添加以下宝石

gem 'therubyracer'
gem 'execjs'

和运行

bundle install

OR

安装Node.js为所有项目永久修复它。

安装javascript运行库(如nodejs)可以解决这个问题

要在ubuntu上安装nodejs,可以在终端中输入以下命令:

sudo apt-get install nodejs

使用yum在系统上安装nodejs,在终端中输入以下命令:

yum -y install nodejs