Can't complete the Getting Started tutorial due to ExecJS::RuntimeError in Home#index

I have just installed Rails 3.2.1 on my Xubuntu using the gem system and I try to make the tutorial Getting Started with Rails — Ruby on Rails Guides and on section 4.3 Setting the Application Home Page I get the following error

ExecJS::RuntimeError in Home#index

Showing /home/xonx/rails/blog/app/views/layouts/application.html.erb where line #6 raised:

  (in /home/xonx/rails/blog/app/assets/javascripts/home.js.coffee) Extracted source (around line #6):

3: <head> 4: <title>Blog</title> 5: <%= stylesheet_link_tag "application", :media => "all" %> 6: <%= javascript_include_tag "application" %> 7: <%= csrf_meta_tags %> 8: </head> 9: <body> Rails.root: /home/xonx/rails/blog

I was doing everything exactly as said in the tutorial and don't understand what the problem might be.

Your error message isn't very informative! Do you have a javascript runtime installed? You can try:

$sudo apt-get install nodejs

Or adding

gem 'therubyracer', '>=0.8.2'

to your Gemfile, then run bundle install.

-----Oprindelig meddelelse-----

Your error message isn't very informative!

Yeah, but it's the only one I've got, unfortunately.

gem 'therubyracer', '>=0.8.2'

It helped. The error disappeared. Thank you.

Out of curiosity. This worked on a Ubuntu 11.10, but on

an Ubuntu 10.04 the package seems not present.

Could it be the case that this package was only recently

added to the Debian/Ubuntu standard package lists?

Thanks,

Peter