1

I'm working through Michael Hartl's Ruby on Rails Tutorial and all steps have worked as expected up to the start of section 2.2.1.

The first sentence says visiting the root will display the default Rails page. But it doesn't; it shows "hello world" because the tutorial in section 2.1 has us define the root to be application#hello right before deploying to Heroku. If I go to http://localhost:3000/users/, I get an error:

ExecJS::ProgramError in Users#index

Showing C:/Users/dfretz/dfretz/Coursera/Rails_tutorial/toy_app/app/views/layouts/application.html.erb where line #6 raised:

TypeError: Object doesn't support this property or method

Since this is scaffolding-generated code, I don't know how to fix this, or even what files you'd need to see in order to help.

Can someone please tell me what I did wrong?

amdixon
  • 3,814
  • 8
  • 25
  • 34
Dan F
  • 33
  • 4
  • it is a windows issue , see this QA http://stackoverflow.com/questions/28312460/object-doesnt-support-this-property-or-method-rails-windows-64bit – Tachyons Oct 18 '15 at 04:39
  • Possible duplicate of [ExecJS::RuntimeError in Users#index (RoR)](http://stackoverflow.com/questions/13530042/execjsruntimeerror-in-usersindex-ror) – Shiva Oct 18 '15 at 05:33
  • Thank you, it is working now. The solution was in the link provided by @Tachyons. In the \app\views\layouts\application.html.erb file, changing line 6 from <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> to <%= javascript_include_tag '**defaults**', 'data-turbolinks-track' => true %> fixed it. For the record, I am running on Windows 7. Thanks! – Dan F Oct 18 '15 at 20:48

1 Answers1

1

Since you're new, here's how to debug it:


This is your error:

C:/Users/dfretz/dfretz/Coursera/Rails_tutorial/toy_app/app/views/layouts/application.html.erb where line #6

This gives you a specific file to look at, and a line to observe.

In my experience, line 6 of application.html.erb is going to be in the <meta> data of the app; I have a feeling that it's going to be the Javascript files.

--

In fact, as we can also see from the error:

ExecJS::ProgramError

This basically suggests we're dealing with a JS problem.

There are a number of JS problems you can get; this one seems to be a deep-set issue (probably with Windows 8)... ExecJS::RuntimeError in Users#index (RoR)

The bottom line is I think you need to install NodeJS, or assign another JS runtime. I just installed NodeJS when I had the issue...

You'll probably want to look at this resource and follow the steps: How can I use Nodejs with Windows 7?

Community
  • 1
  • 1
Richard Peck
  • 76,116
  • 9
  • 93
  • 147