语法错误,意外的keyword_ensure,期望第61行的输入结束 - haml

时间:2016-06-11 16:23:42

标签: ruby-on-rails ruby haml

我正在使用以下代码。它来自github(https://github.com/thinkpixellab/agent8ball)中的8agentball项目。

我是Ruby和Rails的初学者(今天开始学习),当我尝试执行它时遇到错误。我在互联网上搜索了4个多小时,没有找到任何东西。

- uncompiled = Rails.env == 'development' && params.has_key?('uncompiled')
- content_for :header do
  = game_js(uncompiled)
    %link{:rel => 'canonical', :href => 'http://agent8ball.com'}
    %a#fork_me{:href => "https://github.com/thinkpixellab/agent8ball"}
    %img{:alt => "Fork me on GitHub", :src => "http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"}

- if Rails.env == 'development'
  - if(uncompiled)
    = link_to "Uncompiled", root_path, :id => 'debug', :title => 'Go to compiled version'
  - else
    = link_to "Compiled", '/?uncompiled', :id => 'debug', :title => 'Go to uncompiled version'

我收到了这个错误:

  

显示   /Users/user/Documents/61/v4/agent8ball-master/app/views/main/index.haml   第#xx行:

/Users/user/Documents/61/v4/agent8ball-master/app/views/main/index.haml:xx: syntax error, unexpected keyword_ensure, expecting end-of-input

我尝试缩进代码,在if / else和/或之后尝试put-end但是没有用。

有什么想法吗?

谢谢

0 个答案:

没有答案