1

Firstly I'm still busy learning RoR so my understanding is limited. I created a new simple project and generated my first scaffold named 'Person'. When I start up my WEBrick server I go to localhost:3000/people I get the following runtime error:

ExecJS::RuntimeError in People#index Showing C:/Users/Dean/Desktop/guestbook/app/views/layouts/application.html.erb where line #6 raised: (in C:/Users/Dean/Desktop/guestbook/app/assets/javascripts/people.js.coffee) Extracted source (around line #6):

3: <head>
4:   <title>Guestbook</title>
5:   <%= stylesheet_link_tag    "application", :media => "all" %>
6:   <%= javascript_include_tag "application" %>
7:   <%= csrf_meta_tags %>
8: </head>
9: <body>

If any more clarification is needed please let me know and I'll gladly update my question. I'm no expert but it looks like it's something to do with.. the coffeescript gem? I'm really just spitballin' here... Thanks in advance!

people.js.coffee:

# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
4
  • where's the rest of the error? Commented Oct 2, 2013 at 5:43
  • @sevenseacat full stacktrace added. (I tried to format it nicely but I gave up adding spaces line by line after about 10mins) Commented Oct 2, 2013 at 5:51
  • What does people.js.coffee look like? That's what it is complaining about, right? Commented Oct 2, 2013 at 6:03
  • @muistooshort - Please have a look at my updated question. PS - thanks for that tip, it's been driving me insane! Commented Oct 2, 2013 at 6:14

1 Answer 1

3

ExecJS::RuntimeErrors are typically caused by syntax errors in your coffeescript. Check your people.js.coffee file around line 6 and make sure it is syntactically correct. If you are relatively unfamiliar with coffeescript, http://js2coffee.org/ converts between JS and coffee and might be helpful. .js.coffee files will only accept coffeescript.

Sign up to request clarification or add additional context in comments.

3 Comments

That's quite bad though then isn't it? Since all that was auto generated? Also I just saw that that file is actually empty.
That stacktrace is just a log of all the functions that were involved in trying to execute your script. The js execution caused an error in the function that called it, which caused an error in its caller and so on. The first error is in your coffeescript, which is the one you would need to fix. Could you please post your person.js.coffee?
Have a look at my updated question. It's just empty. Besides for generic comments.

Your Answer

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