Rails3.2.x new project启动错误:Could not find a JavaScript runtime.

刚刚更新了ruby和rails的版本,发现rails越来越重量级了。。。

rails new project后执行rake db:create出现如下错误及提示:

Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.

需要在Gemfile中添加两个gem:

gem 'execjs'
gem 'therubyracer'  # Google V8 embedded within Ruby

重新运行rake db:create,通过。

参考:

https://github.com/sstephenson/execjs

原文地址:https://www.cnblogs.com/arrongao/p/2785353.html