2012-04-07 13 views
7

wenn ich den Befehl "Rails s" folgenden Fehler geben kommt bitte hilf mir! noch bin ich Projekt in Schienen und dann geben diesem BefehlRails-Server startet nicht?

[email protected]:~# cd mon 
[email protected]:~/mon# rails s 
/usr/lib/ruby/gems/1.8/gems/execjs-1.3.0/lib/execjs/runtimes.rb:50:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable) 
    from /usr/lib/ruby/gems/1.8/gems/execjs-1.3.0/lib/execjs.rb:5 
    from /usr/lib/ruby/gems/1.8/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require' 
    from /usr/lib/ruby/gems/1.8/gems/coffee-script-2.2.0/lib/coffee_script.rb:1 
    from /usr/lib/ruby/gems/1.8/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require' 
    from /usr/lib/ruby/gems/1.8/gems/coffee-script-2.2.0/lib/coffee-script.rb:1 
    from /usr/lib/ruby/gems/1.8/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `require' 
    from /usr/lib/ruby/gems/1.8/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1 
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:68:in `require' 
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:68:in `require' 
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:66:in `each' 
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:66:in `require' 
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:in `each' 
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:in `require' 
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler.rb:119:in `require' 
    from /root/mon/config/application.rb:7 
    from /usr/lib/ruby/gems/1.8/gems/railties-3.2.3/lib/rails/commands.rb:53:in `require' 
    from /usr/lib/ruby/gems/1.8/gems/railties-3.2.3/lib/rails/commands.rb:53 
    from /usr/lib/ruby/gems/1.8/gems/railties-3.2.3/lib/rails/commands.rb:50:in `tap' 
    from /usr/lib/ruby/gems/1.8/gems/railties-3.2.3/lib/rails/commands.rb:50 
    from script/rails:6:in `require' 
    from script/rails:6 

Antwort

11

hinzufügen

gem 'therubyracer' 

zu Ihrem Gemfile und

bundle 

Befehl

+0

@ fl00r Hay danke euch beiden, es funktioniert ... aber jedes Mal, wenn ich ein neues Projekt erstelle, muss ich "Gem Therubyracer" in Gemfile einfügen, warum ist das so? –

4

benötigen Sie einen JavaScript-Laufzeit wie zu installieren:

gem install therubyracer

oder

http://nodejs.org/

Dies ist Wird von der Asset-Pipeline in Rails 3 zur Erstellung des coffeescript verwendet.

+0

i therubyracer Juwel, aber immer noch gleichen installiert laufen. –

+0

Hast du den neuen Edelstein zu deiner 'Gemfile' hinzugefügt und eine' Gemfile.lock' Datei gelöscht? – JellicleCat