sstephenson/execjs

(RUBY) Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)

JaeSeung opened this issue · 2 comments

I hope to activate rails server, but it couldn't.... please help me ... i don;t know what i have to do;;;;;

/home/ec2-user/.rvm/gems/ruby-2.0.0-p643/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/ec2-user/.rvm/gems/ruby-2.0.0-p643/gems/execjs-2.6.0/lib/execjs.rb:5:inmodule:ExecJS'
from /home/ec2-user/.rvm/gems/ruby-2.0.0-p643/gems/execjs-2.6.0/lib/execjs.rb:4:in <top (required)>' from /home/ec2-user/.rvm/gems/ruby-2.0.0-p643/gems/uglifier-2.7.2/lib/uglifier.rb:3:inrequire'
from /home/ec2-user/.rvm/gems/ruby-2.0.0-p643/gems/uglifier-2.7.2/lib/uglifier.rb:3:in <top (required)>' from /home/ec2-user/.rvm/gems/ruby-2.0.0-p643/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:inrequire'
from /home/ec2-user/.rvm/gems/ruby-2.0.0-p643/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in block (2 levels) in require' from /home/ec2-user/.rvm/gems/ruby-2.0.0-p643/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:ineach'
from /home/ec2-user/.rvm/gems/ruby-2.0.0-p643/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in block in require' from /home/ec2-user/.rvm/gems/ruby-2.0.0-p643/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:ineach'
from /home/ec2-user/.rvm/gems/ruby-2.0.0-p643/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in require' from /home/ec2-user/.rvm/gems/ruby-2.0.0-p643/gems/bundler-1.10.6/lib/bundler.rb:134:inrequire'
from /home/ec2-user/config/application.rb:7:in <top (required)>' from /home/ec2-user/.rvm/gems/ruby-2.0.0-p643/gems/railties-4.0.1/lib/rails/commands.rb:74:inrequire'
from /home/ec2-user/.rvm/gems/ruby-2.0.0-p643/gems/railties-4.0.1/lib/rails/commands.rb:74:in block in <top (required)>' from /home/ec2-user/.rvm/gems/ruby-2.0.0-p643/gems/railties-4.0.1/lib/rails/commands.rb:71:intap'
from /home/ec2-user/.rvm/gems/ruby-2.0.0-p643/gems/railties-4.0.1/lib/rails/commands.rb:71:in <top (required)>' from bin/rails:4:inrequire'
from bin/rails:4:in `

'

This fixed it for me. Old post, but this may help someone else:
which node
And then
sudo ln -s "whatever path came out" /usr/bin/node

If you run into this issue, you may be tempted to add therubyracer to your gemfile. Prefer to use NodeJS instead, if your application runs in a multithreaded environment. Sidekiq itself considers therubyracer as a non thread-safe gem.