Javascript – Rails – Could not find a JavaScript runtime

javascriptnode.jsruby-on-railsruby-on-rails-3ruby-on-rails-3.1

I created a new Rails project using rails 3.1.0.rc4 on my local machine but when I try to start the server I get:
Could not find a JavaScript runtime. See here for a list of available runtimes. (ExecJS::RuntimeUnavailable)

Note: This is not about Heroku.

Best Answer

Installing a javascript runtime library such as nodejs solves this

To install nodejs on ubuntu, you can type the following command in the terminal:

sudo apt-get install nodejs

To install nodejs on systems using yum, type the following in the terminal:

yum -y install nodejs