@hauleth It is not in the creation that the error happens, but in the switch. It doesn't matter if the variable exists or is empty because the variable is expanded and the result is a switch call without arguments. If you enclose it in quotes, like you did in the rbenv_shell function then you have one argument that happens to be empty. ;D
Thanks for this. It is great. Have you considered submitting it to oh-my-fish?