启动Rails服务器时,ExecJS :: RuntimeUnavailable错误 [英] ExecJS::RuntimeUnavailable error when I start the Rails server

查看:139
本文介绍了启动Rails服务器时,ExecJS :: RuntimeUnavailable错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个新的Rails应用程序.当我尝试启动服务器时,出现以下错误:

I have created a new Rails application. When I try to start the server I get the following error:

[bathakarai@Project1-CO samp]$ rails server
/home/bathakarai/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.13/lib/rails/script_rails_loader.rb:11: warning: Insecure world writable dir /usr in PATH, mode 040777
/home/bathakarai/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.4/lib/bundler/runtime.rb:216: warning: Insecure world writable dir /usr in PATH, mode 040777
/home/bathakarai/.rvm/gems/ruby-2.0.0-p0/gems/execjs-1.4.0/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
    from /home/bathakarai/.rvm/gems/ruby-2.0.0-p0/gems/execjs-1.4.0/lib/execjs.rb:5:in `<module:ExecJS>'
    from /home/bathakarai/.rvm/gems/ruby-2.0.0-p0/gems/execjs-1.4.0/lib/execjs.rb:4:in `<top (required)>'
    from /home/bathakarai/.rvm/gems/ruby-2.0.0-p0/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
    from /home/bathakarai/.rvm/gems/ruby-2.0.0-p0/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `<top (required)>'
    from /home/bathakarai/.rvm/gems/ruby-2.0.0-p0/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
    from /home/bathakarai/.rvm/gems/ruby-2.0.0-p0/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `<top (required)>'
    from /home/bathakarai/.rvm/gems/ruby-2.0.0-p0/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `require'
    from /home/bathakarai/.rvm/gems/ruby-2.0.0-p0/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `<top (required)>'
    from /home/bathakarai/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `require'
    from /home/bathakarai/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
    from /home/bathakarai/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `each'
    from /home/bathakarai/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `block in require'
    from /home/bathakarai/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `each'
    from /home/bathakarai/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `require'
    from /home/bathakarai/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.4/lib/bundler.rb:132:in `require'
    from /home/bathakarai/gold/Ruby/Practice/Rails/samp/config/application.rb:7:in `<top (required)>'
    from /home/bathakarai/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.13/lib/rails/commands.rb:53:in `require'
    from /home/bathakarai/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.13/lib/rails/commands.rb:53:in `block in <top (required)>'
    from /home/bathakarai/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
    from /home/bathakarai/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

如何解决此错误?

推荐答案

尝试

sudo gem install therubyracer

gem install therubyracer

希望这会有所帮助

这篇关于启动Rails服务器时,ExecJS :: RuntimeUnavailable错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆