六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 63|回复: 0

Could not find a JavaScript runtime

[复制链接]

升级  60%

6

主题

6

主题

6

主题

童生

Rank: 1

积分
30
 楼主| 发表于 2013-1-15 13:33:36 | 显示全部楼层 |阅读模式
My Rails3.1 app worked fine on Windows but got the "Could not find JavaScript runtime" error when running on Linux.
Solution:
 
gem 'therubyracer', :platforms => :ruby The trick is knowing that :platforms => :ruby actually means only use this gem with "C Ruby(MRI) or Rubinius, but NOT Windows."
 
Windows has a builtin JavaScript engine which execjs can locate. On Linux there is not a builtin although there are plenty available to be installed. therubyracer is one of them.
 
Also, this problem could be resloved by installing nodejs
 
sudo apt-get install nodejs
 
 
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表