3

I have been struggling to find an answer to this question, obviously I haven't done it yet. I tried coding my first little bit, I can open the server with no problem but as I open it, but insted of showing me what I coded, the server tells me: TypeError: Object doesn't support this property or method Extracted source (around line #7):

    CTYPE html>
<html>
  <head>
    <title>Programar101</title>
    <%= csrf_meta_tags %>

    <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track': 'reload' %>
    <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
  </head>

  <body>
    <%= yield %>
  </body>
</html>

In my command prompt, when the error occurs, it gives me this:

ActionView::Template::Error (TypeError: Object doesn't support this property or method):
    4:     <title>APP</title>
    5:     <%= csrf_meta_tags %>
    6:
    7:     <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track': 'reload' %>
    8:     <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
    9:   </head>
   10:

app/views/layouts/application.html.erb:7:in `_app_views_layouts_application_html_erb__332994069_78270120'
  Rendering C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb within rescues/layout
  Rendering C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_source.html.erb
  Rendered C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_source.html.erb (60.1ms)
  Rendering C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
  Rendered C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (32.6ms)
  Rendering C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb
  Rendered C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (3.0ms)
  Rendered C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb within rescues/layout (5146.8ms)

Thank you in advance

M. Vega
  • 53
  • 5

2 Answers2

1

I think this SO post has some good details into understanding the problem. I had the exact issue and followed the stack trace and it seemed the cause is from execjs. However what differs is that changing runtimes.rb does NOT fix the issue. Removing the //= require_tree . does fix but that is not right solution either as it is quick fix.

One working good solution is to install Node and I have heard this fixes the problem. I can confirm this fixed the problem for me. I think it has to do with the runtimes.rb file and how the default JS env on Windows sucks.

Sticky
  • 3,671
  • 5
  • 34
  • 58
  • it's not the same error, so I doubt the fix will be the same. – sevenseacat Apr 30 '17 at 08:31
  • I'm not sure if it's same error because My error is same as this one in that the stylesheet has problems loading but when I remove the `//= require_tree .` from `application.js` the problem goes away. The quick fix solution is identical. – Sticky Apr 30 '17 at 08:33
  • That's another way to avoid the problem without actually fixing it. If you want JavaScript in your app, don't do that. – sevenseacat Apr 30 '17 at 08:34
  • Ok I changed my answer quite a bit after trying a few more things and clarifying. Pls no downvote, I try my best – Sticky Apr 30 '17 at 08:40
-2

You need to change 'application' to 'default' in lines 6 and 7.

<%= stylesheet_link_tag 'default', media: 'all', 'data-turbolinks-track': 'reload' %> <%= javascript_include_tag 'default', 'data-turbolinks-track': 'reload' %>

Dataminded
  • 62
  • 3