Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes nginx nginx

Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes


I get this problem every time I setup a new ubuntu/nginx/passenger/rails server. Try this

First install node:

sudo apt-get install nodejs

then add your path env to your /etc/nginx/nginx.conf like so:

env PATH;

or to be more specific (if node is located at /usr/bin/nodejs):

env PATH=/bin:/usr/bin;


Uncomment line with 'therubyracer' gem, like this:

gem 'therubyracer',  platforms: :ruby

and run bundle install. I hope this will help you.


I had run into a similar problem and I had nodejs already running on my machine. It was after all the looking had I came to realize I need to include execjs gem in my Gemfile:

gem "execjs", "~> 2.8.1"

And run bundle install