RailsのCould not find a JavaScript runtimeへの対処

Rails3.2をインストールしてサンプルアプリケーションを作った後に素の状態でrailsを起動しようとすると、次のエラーが出ます。

rails s
$HOME/.rvm/gems/ruby-1.9.2-p290/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 $HOME/.rvm/gems/ruby-1.9.2-p290/gems/execjs-1.3.0/lib/execjs.rb:5:in `'
from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/execjs-1.3.0/lib/execjs.rb:4:in `'
from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `'
from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `'
from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/coffee-rails-3.2.1/lib/coffee-rails.rb:1:in `require'
from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/coffee-rails-3.2.1/lib/coffee-rails.rb:1:in `'
from $HOME/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require'
from $HOME/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from $HOME/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `each'
from $HOME/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `block in require'
from $HOME/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `each'
from $HOME/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `require'
from $HOME/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler.rb:122:in `require'
from /tmp/rails_project/config/application.rb:7:in `'
from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/commands.rb:53:in `require'
from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/commands.rb:53:in `block in '
from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/commands.rb:50:in `tap'
from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/commands.rb:50:in `'
from script/rails:6:in `require'
from script/rails:6:in `

'


この場合、アプリケーションのフォルダの中のGemfileに

gem 'execjs'
gem 'therubyracer'

を書いて上書き保存し、bundle installをしてからrails sで起動すると動きます。


Railsはインストールしてハローワールドすらしてない状態なのでなぜこうなるのか分かりませんが、Google検索するとこの対応がたくさん出てきたので間違いないようです。