Q:

Why am I not getting same result using while and until in ruby?

Ok, I'm using Ruby 2.26 on windows x64.
The thing is, I'm really just new at learning how to code, so I'm not sure wether this is truly a bug or it's simply my mistakes somewhere, because the bug is VERY VERY SIMPLE it's kinda dumb(?) @_@
The 'while' and 'until' operator.
As far as I know,
action = gets.chomp
until action == "a" || action == "b"
  puts "Answer a or b"
  action = gets.chomp
end

puts "The answer: " + action

and
action = gets.chomp
while action != "a" || action != "b"
  puts "Answer a or b"
  action = gets.chomp
end

puts "The answer: " + action

should result in the same thing. But using the 'while' operator here, get me infinite loop even if I'm putting "a" or "b" on user input on the powershell.
Anyone can tell me why this is? Or is this truly a bug? (which is a shame since a while and until operator should be a very basic logic operator right?)

A:

Solution
The opposite of 
action == "a" || action == "b"

is 
action != "a" && action != "b"

See De Morgan's Laws.
Your code
action != "a" || action != "b"

is always true :

if action is "a", it is false || true, which is true
if action is "b", it is true || false, which is true
if action is neither, it is true || true, which is true

So your loop really is while true.
Note : There surely are bugs in Ruby, and some of them might be trivially simple. It doesn't mean that anything you don't understand is a bug, though. ;)
Language and boolean logic
It isn't always easy to extract boolean logic from sentences :
"You like cats and dogs"
You would like to know if you like an animal. To do so, you need to check if animal is a dog or a cat.
If you check that animal is a dog and a cat, you surely won't like the animal!

