Onur Özgür ÖZKAN

Php, Ruby, Kebab, Git Geek

Rails 3.1 and ExecJS::RuntimeUnavailable Error

When i start the rails server

1
rails server -b 0.0.0.0 -p 3000 -e development

I get the

1
2
/gems/execjs-1.2.4/lib/execjs/runtimes.rb:45:in `autodetect': Could not find a JavaScript runtime. See
https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)

errors after searching on google i found the solutions.

1
2
3
4
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

You must install a server site js compiler like node.js or an other solution is adding ‘therubyracer’, ‘>= 0.8.2’ at gemfile.

1
gem 'therubyracer', '>= 0.8.2'

Best Regards.