title: Range loop works by itself, but not inside an until loop
body: <pre><code>def bubble_sort(arr)
      sorted = false
      until sorted
          sorted = true
          (0...arr.length-2).each do |i|
              if arr[i] &gt; arr[i+1]
                  arr[i], arr[i+1] = arr[i+1], arr[i]
                  sorted = false
              end
          end
      end
      arr
  end
  
  bubble_sort([4,6,2,8,1])
  </code></pre>
  
  <p>The following is the error message:</p>
  
  <pre><code>(eval):367: (eval):367: compile error (SyntaxError)
  (eval):359: syntax error, unexpected kDO_COND, expecting kEND
          (0...arr.length-2).each do |i|
                                    ^
  (eval):367: syntax error, unexpected kEND, expecting $end
  </code></pre>
  
  <p>I don't understand why it is saying unexpected kEND</p>