ExecJS and could not find a JavaScript runtime

srboisvert picture srboisvert · Jun 8, 2011 · Viewed 256.6k times · Source

I'm trying to use the Mongoid / Devise Rails 3.1 template (Mongoid and Devise), and I keep getting an error stating ExecJS cannot find a JavaScript runtime. Fair enough when I didn't have any installed, but I've tried installing Node.js, Mustang and the Ruby Racer, but nothing is working.

I could not find a JavaScript runtime. See sstephenson/ExecJS (GitHub) for a list of available runtimes (ExecJS::RuntimeUnavailable).

What do I need to do to get this working?

Answer

vincent jacquel picture vincent jacquel · Jun 12, 2011

Just add ExecJS and the Ruby Racer in your gem file and run bundle install after.

gem 'execjs'

gem 'therubyracer'

Everything should be fine after.