`
fantaxy025025
  • 浏览: 1309089 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类

Rails3_安装_报错_解决_Could not find a JavaScript runtime_(ExecJS::RuntimeUnavailable)

 
阅读更多

 

错误:

没有js的运行环境导致的:

lijg@lijg-desktop:~/workruby/helloapp$ ruby script/rails console
/home/lijg/.rvm/gems/ruby-1.9.2-p290/gems/execjs-1.2.7/lib/execjs/runtimes.rb:47:in `autodetect': Could not find a JavaScript runtime . See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)

 

解决方法1:

Adding the following gems to my Gemfile solved the issue:

gem 'execjs'
gem 'therubyracer'

Then of course:

bundle install

 

解决方法2:

安装nodejs

lijg@lijg-desktop:~/workruby/helloapp$ sudo apt-cache search nodejs
[sudo] password for lijg:
coffeescript - interpreter and compiler for the CoffeeScript language
nodejs - Node.js event-based server-side javascript engine
nodejs-dbg - Node.js event-based server-side javascript engine (debug)
nodejs-dev - Development files for Node.js

 

 

 

 

==END==

======

====

==

|

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics