3

i am getting the following error. tried to search and try to install extjs, bundler etc gems still am getting the error

harsha@harshamv:~/www/simple_cms$ rails s
/home/harsha/.rvm/gems/ruby-2.0.0-p247/gems/execjs-2.0.2/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
    from /home/harsha/.rvm/gems/ruby-2.0.0-p247/gems/execjs-2.0.2/lib/execjs.rb:5:in `<module:ExecJS>'
    from /home/harsha/.rvm/gems/ruby-2.0.0-p247/gems/execjs-2.0.2/lib/execjs.rb:4:in `<top (required)>'
    from /home/harsha/.rvm/gems/ruby-2.0.0-p247/gems/uglifier-2.3.1/lib/uglifier.rb:3:in `require'
    from /home/harsha/.rvm/gems/ruby-2.0.0-p247/gems/uglifier-2.3.1/lib/uglifier.rb:3:in `<top (required)>'
    from /home/harsha/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
    from /home/harsha/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
    from /home/harsha/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
    from /home/harsha/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
    from /home/harsha/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
    from /home/harsha/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
    from /home/harsha/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
    from /home/harsha/www/simple_cms/config/application.rb:7:in `<top (required)>'
    from /home/harsha/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.1/lib/rails/commands.rb:74:in `require'
    from /home/harsha/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.1/lib/rails/commands.rb:74:in `block in <top (required)>'
    from /home/harsha/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.1/lib/rails/commands.rb:71:in `tap'
    from /home/harsha/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.1/lib/rails/commands.rb:71:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'
Harsha M V
  • 54,075
  • 125
  • 354
  • 529
  • possible duplicate of [execJs: 'Could not find a JavaScript runtime' but execjs AND therubyracer are in Gemfile](http://stackoverflow.com/questions/9202324/execjs-could-not-find-a-javascript-runtime-but-execjs-and-therubyracer-are-in) – givanse Nov 14 '14 at 09:59

2 Answers2

3

try to install latest nodejs.

more details can be found here ExecJS and could not find a JavaScript runtime

Community
  • 1
  • 1
Ivan Tarapon
  • 219
  • 2
  • 4
1

Ubuntu Users

I'm on Ubuntu 11.04 and had similar issues. Installing Node.js fixed it.

As of Ubuntu 13.04 x64 you only need to run:

 sudo apt-get install nodejs

This will solve the problem.

CentOS/RedHat Users

 sudo yum install nodejs

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

   gem 'execjs'

  gem 'therubyracer'
Prabhakar
  • 6,458
  • 2
  • 40
  • 51