trying to run the rails server i get this error:

/var/lib/gems/2.1.0/gems/execjs-2.6.0/lib/execjs/runtimes.rb:48:in `autodetect': Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
    from /var/lib/gems/2.1.0/gems/execjs-2.6.0/lib/execjs.rb:5:in `<module:ExecJS>'
    from /var/lib/gems/2.1.0/gems/execjs-2.6.0/lib/execjs.rb:4:in `<top (required)>'
    from /var/lib/gems/2.1.0/gems/uglifier-2.7.2/lib/uglifier.rb:3:in `require'
    from /var/lib/gems/2.1.0/gems/uglifier-2.7.2/lib/uglifier.rb:3:in `<top (required)>'
    from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:76:in `require'
    from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:76:in `block (2 levels) in require'
    from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:72:in `each'
    from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:72:in `block in require'
    from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:61:in `each'
    from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:61:in `require'
    from /usr/lib/ruby/vendor_ruby/bundler.rb:133:in `require'
    from /home/acne/Documents/WWW/web/config/application.rb:7:in `<top (required)>'
    from /usr/lib/ruby/vendor_ruby/rails/commands/commands_tasks.rb:79:in `require'
    from /usr/lib/ruby/vendor_ruby/rails/commands/commands_tasks.rb:79:in `block in server'
    from /usr/lib/ruby/vendor_ruby/rails/commands/commands_tasks.rb:76:in `tap'
    from /usr/lib/ruby/vendor_ruby/rails/commands/commands_tasks.rb:76:in `server'
    from /usr/lib/ruby/vendor_ruby/rails/commands/commands_tasks.rb:40:in `run_command!'
    from /usr/lib/ruby/vendor_ruby/rails/commands.rb:17:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

How can i solve this? Thanks for your time !

  • This is the error: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable) Do you have a JS runtime from the list of available runtimes? – Thomas Ward Oct 14 '15 at 22:25

Either Install Node Js or install therubyracer gem

gem install therubyracer
  1. Comment the gem "therubyracer".
  2. install nodejs.
  3. run the server again.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.