How to resolve “Could not find a JavaScript runtime” with Ruby on Rails App

If you tried to start Rails server and got this error:

/usr/lib/ruby/gems/1.8/gems/execjs-1.3.0/lib/execjs/runtimes.rb:50:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)

In Ubuntu, you can fix it installing node.js:

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install nodejs-dev

If you have other OS please look here: https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager

After you should starting Rails server with successful.

Please recommend me if this post help you: Recommend Me

Posted in Ruby on Rails, Ubuntu at março 1st, 2012. No Comments.

 Assinar RSS Feed