Here's a file that is parsed wrongly when it has no .rb extension. The sharp-bang sequence at the top looks correct to me. Attaching both the input file and the generated tags file. The problem is present both in emacs-26 and master.