1

私はレールに慣れていないので、レールサーバーの起動中にばかげた質問があります。この間違いがあります

rails s
/var/lib/gems/1.8/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 /var/lib/gems/1.8/gems/execjs-1.4.0/lib/execjs.rb:5
    from /var/lib/gems/1.8/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
    from /var/lib/gems/1.8/gems/coffee-script-2.2.0/lib/coffee_script.rb:1
    from /var/lib/gems/1.8/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
    from /var/lib/gems/1.8/gems/coffee-script-2.2.0/lib/coffee-script.rb:1
    from /var/lib/gems/1.8/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `require'
    from /var/lib/gems/1.8/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1
    from /var/lib/gems/1.8/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `require'
    from /var/lib/gems/1.8/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `require'
    from /var/lib/gems/1.8/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `each'
    from /var/lib/gems/1.8/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `require'
    from /var/lib/gems/1.8/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `each'
    from /var/lib/gems/1.8/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `require'
    from /var/lib/gems/1.8/gems/bundler-1.2.3/lib/bundler.rb:128:in `require'
    from /home/gorysko/rails/rails_project/first_app/config/application.rb:7
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/commands.rb:53:in `require'
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/commands.rb:53
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/commands.rb:50:in `tap'
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/commands.rb:50
    from script/rails:6:in `require'
    from script/rails:6

しかし、すべてのインストールは本に書かれているとおりに行われ、すべての依存関係も良好です

4

1 に答える 1

2

この行を gemfile に追加してみてください

gem 'therubyracer'

Ruby 内から JavaScript を評価できます。ここで確認できます。

于 2012-12-12T13:46:14.347 に答える