0

In my ruby on rails web application I am getting error below:

ExecJS::RuntimeError in Users#new

Showing C:/Sites/VideoResume/app/views/layouts/application.html.erb where line #6 raised:


  (in C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/turbolinks-1.1.1/lib/assets/javascripts/turbolinks.js.coffee)

enter image description here

Kindly suggest me, How do I resolve it. Waiting for reply. Thanks.

user88
  • 1,174
  • 3
  • 27
  • 51
  • Is `rake assets:precompile` working for you? Do you have *gem 'therubyracer'* in you Gemfile? – faron Jun 17 '14 at 09:51
  • no but I was try to install `therubyracer`, then I am getting some more issues , that's why I remove it. – user88 Jun 17 '14 at 09:54
  • possible duplicate of [Error when running rails app - ExecJS::RuntimeError](http://stackoverflow.com/questions/8362458/error-when-running-rails-app-execjsruntimeerror) – Kinaan Khan Sherwani Sep 03 '15 at 08:59

2 Answers2

0

Did you try installing nodejs. First do that it should solve the problem. How to Install Nodejs on ubuntu

some helpful links and possible duplicates are

ExecJS::RuntimeError

ExecJS::RuntimeError NodeJS Install

Community
  • 1
  • 1
Kinaan Khan Sherwani
  • 1,504
  • 16
  • 28
  • I have install node.js and when I check this command `node -v` on Command Prompt with Ruby and Rails then it show me `'node' is not recognized as an internal or external command, operable program or batch file.` – user88 Jun 17 '14 at 10:07
  • if it has been installed then it means that nodejs has not been added to your system path. – Kinaan Khan Sherwani Jun 17 '14 at 10:11
  • then what should I do? – user88 Jun 17 '14 at 10:12
  • what is the path of your nodejs installation. where did you install nodejs ? – Kinaan Khan Sherwani Jun 17 '14 at 10:13
  • C:\Program Files\nodejs – user88 Jun 17 '14 at 10:20
  • @user88 try SET PATH=C:\Program Files\Nodejs;%PATH% in command prompt and then try running node – Mandeep Jun 17 '14 at 10:23
  • use this link and add the above given path to PATH environment variable `http://www.java.com/en/download/help/path.xml` . another thing if you have installed nodejs from windows binary it would have already added it to PATH try restarting the command prompt also. you can also use user2675613's solution but to do it permanently you will have to use method i mentioned – Kinaan Khan Sherwani Jun 17 '14 at 10:24
  • now try `node -v` if you have added the path successfully it should work now . – Kinaan Khan Sherwani Jun 17 '14 at 10:33
  • yes it show me the version on windows command prompt, but `ExecJS::RuntimeError` still come on the browser, How do I resolve it – user88 Jun 17 '14 at 10:39
0

If you look at the github link given above therubyracer gem in your new rails app. It says

ExecJS lets you run JavaScript code from Ruby. It automatically picks the best runtime available to evaluate your JavaScript program, then returns the result to you as a Ruby object.

ExecJS supports these runtimes:

  • therubyracer - Google V8 embedded within Ruby
  • therubyrhino - Mozilla Rhino embedded within JRuby
  • Node.js
  • Apple JavaScriptCore - Included with Mac OS X
  • Microsoft Windows Script Host (JScript)

Fix

You could solve it by installing any of these runtimes.

You can checkout therubyracer_for_windows someone recommended it here or checkout this

Community
  • 1
  • 1
Mandeep
  • 9,093
  • 2
  • 26
  • 36