2

I have setup a project in rails4 and it is not giving this error when I try to start server. Everything seems fine but I do not know what is wrong. Here is the error:

neha@ubuntu:~/Desktop/myapp$ rails s -p 3001
/home/neha/.rvm/gems/ruby-2.2.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 /home/neha/.rvm/gems/ruby-2.2.0/gems/execjs-2.6.0/lib/execjs.rb:5:in `<module:ExecJS>'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/execjs-2.6.0/lib/execjs.rb:4:in `<top (required)>'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/uglifier-2.7.2/lib/uglifier.rb:3:in `require'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/uglifier-2.7.2/lib/uglifier.rb:3:in `<top (required)>'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `each'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `block in require'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
from /home/neha/Desktop/myapp/config/application.rb:7:in `<top (required)>'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:78:in `require'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `server'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'

I am using Rails 4 on ubuntu 14.04

1 Answer 1

1

Run this command to install node.js and the error will be fixed.

sudo add-apt-repository ppa:chris-lea/node.js 
sudo apt-get -y update 
sudo apt-get -y install nodejs
Sign up to request clarification or add additional context in comments.

1 Comment

If this worked for you, you could accept the answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.