Fix appending .rb to local formulae names

Closes #20926.