Rails - Could not find a JavaScript runtime?

Michael Durrant picture Michael Durrant · Aug 17, 2011 · Viewed 139.6k times · Source

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.

Answer

theTuxRacer picture theTuxRacer · Sep 20, 2011

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