Deaf grandma doesn't allow me to leave until I say bye three times
There are a few small changes that I would make:


Indent the bodies of if/else blocks.
Moving the bye = 0 line to the top of the else block reduces code duplication, and it'll make your code more clear, because it will read like: 'if the input is "BYE", increase the 'bye' counter, else, reset it to 0'.
Ruby has a += operator: bye += 1 is shorthand for bye = bye + 1.
The name bye isn't very accurate, something like bye_shouts_in_a_row is probably better. Picking accurate, meaningful names is often difficult, but it can make code (much) easier to understand, and that makes working with it easier as well.


Applying these gives the following result:

puts "say hi to grandma"

bye_shouts_in_a_row = 0

while bye_shouts_in_a_row &lt; 3 do
  input = gets.chomp

  if input == "BYE"
    bye_shouts_in_a_row += 1
    puts "HEH?!"
  else
    bye_shouts_in_a_row = 0
    if input == input.upcase
      puts "NO, NOT SINCE " + rand(1930..1950).to_s + "!"
    else
      puts "HUH?! SPEAK UP SONNY!"
    end
  end
end

puts "EH?! OH, BYE DEAR!"