This is why you should always indent your code and follow proper coding style. For Ruby, use 2 spaces for indentation after constructs that have an "end." That way, you can always easily check whether you have "unfinished" statements or constructs.