title: Bad value for range
body: <p>When I run the following code:</p>
  
  <pre><code>def db(y)
    return self % y == 0
  end
  
  puts "To number:"
  n = gets.chomp
  
  for i in 1..n
    if i.db(3)
      puts "Fizz!"
      if i.db(5)
        puts "FIZZBUZZ!"
      end
    elsif i.db(5)
      puts "Buzz!"
    else
      puts i
    end
  end
  </code></pre>
  
  <p>I get a "bad value for range" error. Why does this happen how do I fix it? Normal ranges that use variables for some values work perfectly including for loops, why does <em>this</em> not work?</p>
  
  <p>Note: I want the <code>for</code> loop to stay as a <code>for</code> loop.</p>