ExecJS::RuntimeError Rails 3.1 Ubuntu

Ruby on Rails 3.1rc5, Ruby 1.9.2, Kubuntu 11.04

Error compiling asset application.js:
ExecJS::RuntimeError: (in ../app/assets/javascripts/sections.js.coffee)
Served asset /application.js - 500 Internal Server Error

This error is due to Ubuntu not having a javascript runtime installed

The solution is

sudo aptitude install nodejs

Or add 

gem 'therubyracer', '>=0.8.2'

to the Gemfile for the rails project and Run

bundle install

Perfect.

Thank you!

Solved for me

 

I also had this problem, and it was solved installing nodejs, but I used apt-get instead of aptitude:

sudo apt-get install nodejs

 

 

ExecJS::RuntimeError

showing Error C:/Documents and Settings/onevega23/My Documents/Aptana Studio 3 Workspace/depot/app/views/layouts/application.html.erb

 

 

in C:/Documents and Settings/onevega23/My Documents/Aptana Studio 3 Workspace/depot/app/assets/javascripts/products.js.coffee)

 

  This was for Ruby on

 

This was for Ruby on linux, but it looks like you've got a windows install going there.

Do you have a more detailed log?

Post new comment

  • Syntax highlight code surrounded by the {syntaxhighlighter SPEC}...{/syntaxhighlighter} tags, where SPEC is a Syntaxhighlighter options string or "class="OPTIONS" title="the title".
  • Lines and paragraphs break automatically.

More information about formatting options