gpt4 book ai didi

ruby-on-rails - ActionView::Template::不支持错误对象

转载 作者:数据小太阳 更新时间:2023-10-29 08:13:59 26 4
gpt4 key购买 nike

我一直在苦苦寻找这个问题的答案,显然我还没有做到。我尝试编码我的第一个小部分,我可以毫无问题地打开服务器,但是当我打开它时,服务器没有向我展示我编码的内容,而是告诉我:类型错误:对象不支持此属性或方法提取的源代码(大约第 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>

在我的命令提示符下,当错误发生时,它会给我这个:

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)

提前致谢

最佳答案

我认为这个 SO post 有一些很好的细节来理解这个问题。我遇到了确切的问题并跟踪了堆栈跟踪,似乎原因来自 execjs。然而,不同之处在于更改 runtimes.rb 并不能解决问题。删除 //= require_tree . 确实可以修复,但这也不是正确的解决方案,因为它是快速修复。

一个有效的解决方案是安装 Node,我 have heard 这解决了问题。我可以确认这为我解决了问题。我认为这与 runtimes.rb 文件以及 Windows 上的默认 JS 环境如何糟糕有关。

关于ruby-on-rails - ActionView::Template::不支持错误对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39354741/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com