Clarification: Command which gem not showing the gem path correctly in m1 machine
RVM installs "gem" as a shell function gem() instead of relying on a traditional executable. This is why you get the definition of that shell function displayed instead of a path to an executable.
Note that when you run "which" here, you're most probably actually getting the result of "whence" in a zsh shell.