title: Ruby while loop within if statement
body: <p>Using the following code in Ruby:</p>
  
  <pre><code>if (tickFormat.length &gt; 12 &amp;&amp; tickFormat.length &lt; 24)
      i = 1
      while(i &lt; tickFormat.length) do
          if (i%2 != 0)
            tickFormat.at(i)[1] = ''
          end
          i++
      end
  end
  </code></pre>
  
  <p>I get an "unexpected keyword_end" for the 2nd "end" statement.  If I remove the while loop the code runs without error.  Any ideas?</p>