I am working in the following code. It is from the project 8agentball available in github (https://github.com/thinkpixellab/agent8ball).
I am a beginner in Ruby and Rails(started learning today), and I get an error when I try to execute it. I searched in the internet for over 4 hours and did not find anything.
- 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'
And I get this error:
Showing /Users/user/Documents/61/v4/agent8ball-master/app/views/main/index.haml where line #xx raised:
/Users/user/Documents/61/v4/agent8ball-master/app/views/main/index.haml:xx: syntax error, unexpected keyword_ensure, expecting end-of-input
I tried indenting code, tried putting - end after if/else and/or do but to no use.
Any idea?
Thank you