执行rspec时出现Rails 4 / Ruby 2.0错误:安装

时间:2013-08-30 19:49:46

标签: ruby-on-rails ruby rspec execjs

我正在关注互联网上的ruby on rails 4教程。我执行了命令rails generate rspec:install,我得到了这个

rails generate rspec:install

/home/arman/.rvm/gems/ruby-2.0.0-p247/gems/execjs-2.0.1/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/arman/.rvm/gems/ruby-2.0.0-p247/gems/execjs-2.0.1/lib/execjs.rb:5:in `<module:ExecJS>'
    from /home/arman/.rvm/gems/ruby-2.0.0-p247/gems/execjs-2.0.1/lib/execjs.rb:4:in `<top (required)>'
    from /home/arman/.rvm/gems/ruby-2.0.0-p247/gems/uglifier-2.1.1/lib/uglifier.rb:3:in `require'
    from /home/arman/.rvm/gems/ruby-2.0.0-p247/gems/uglifier-2.1.1/lib/uglifier.rb:3:in `<top (required)>'
    from /home/arman/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
    from /home/arman/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
    from /home/arman/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
    from /home/arman/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
    from /home/arman/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
    from /home/arman/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
    from /home/arman/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
    from /home/arman/rails_projects/sample_app/config/application.rb:12:in `<top (required)>'
    from /home/arman/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:44:in `require'
    from /home/arman/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:44:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

我不知道如何解决这个问题。

操作系统:Virtualbox上的Linux Mint 15 Ruby 2.0 Rails 4.0

1 个答案:

答案 0 :(得分:1)

让我们看看你在输出中得到了什么。

无法找到JavaScript运行时。有关可用运行时的列表,请参阅https://github.com/sstephenson/execjs

嗯,听起来很有趣。让我们按照这个链接。

ExecJS支持这些运行时:

我认为你应该安装其中一个。