Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails HAML ActionView::Template::错误语法错误:stdin缺少缩进_Ruby On Rails_Ruby_Haml - Fatal编程技术网

Ruby on rails HAML ActionView::Template::错误语法错误:stdin缺少缩进

Ruby on rails HAML ActionView::Template::错误语法错误:stdin缺少缩进,ruby-on-rails,ruby,haml,Ruby On Rails,Ruby,Haml,我真的卡住了。我有一些代码过去可以使用,但在我的新分支上没有 我越来越 ActionView::Template::Error (SyntaxError: [stdin]:79:1: missing indentation): 1: !!! html 2: %html 3: %head 4: %link{rel: 'shortcut icon', href: image_path('analyst-console-favicon.ico')}

我真的卡住了。我有一些代码过去可以使用,但在我的新分支上没有

我越来越

ActionView::Template::Error (SyntaxError: [stdin]:79:1: missing indentation):
    1: !!! html
    2: %html
    3:   %head
    4:     %link{rel: 'shortcut icon', href: image_path('analyst-console-favicon.ico')}
    5: 
    6:   %body
我的布局文件包含以下内容:

!!! html
%html
  %head
    %link{rel: 'shortcut icon', href: image_path('analyst-console-favicon.ico')}

  %body
我做了一个hextump并验证了缩进是否使用空格

如果我删除
%链接
行,它将返回以下HTML:

<!DOCTYPE html>
<html>
<head></head>
<body></body>
</html>


我甚至不知道该检查什么可能是错误的。

我发现我在咖啡脚本文件中有缩进的注释。当我删除缩进并使注释与文件的左列对齐时,它就工作了。它完全有效


使用快捷图标链接切换咖啡脚本中的缩进是否会破坏代码似乎很奇怪。

错误似乎不在布局中,而是刚刚调用的操作呈现的模板。检查所有模板。我删除了视图文件中的所有代码,因此它现在为空。我有一个特定于该控件的布局,该控件执行了一个
渲染模板:
,因此我复制了上面布局的代码以替换
渲染
命令。我还是犯了同样的错误。我对这个问题投了反对票,但我可能不会删除它。问题是错误消息专门标识了误导性的模板。我被卡住了。我无法在internet上找到与此错误消息相关的信息,因此我希望将此提示留给有此问题的其他人。请查看“”和“”及其所有链接页面。你不会因为某个问题得到否决票或结束票而删除该问题,而是修复该问题。你的问题不可重复;您要求我们帮助调试,但我们无法运行代码并复制问题,这与主题无关。而且,从你的“答案”中(答案不是),你有一个语法错误,这又是离题的。@theTinMan当我在网上搜索“stdin缺少缩进”时,没有结果。应该有一些东西可以为人们指明正确的方向,所以如果没有其他地方,那么这篇文章。原因是一个与错误消息中的文件完全不同的文件,这是一个我希望有人提供给我的提示。如果对此错误消息有更多解释,我同意删除此问题。