This is because when Ansible does "sudo vagrant", it doesn't use an
interactive shell thus your .bash stuff won't be read, and ~/.rvm/bin is
probably not appended to yout path.
Ah, I guess my question should have been, âwhy doesnât ansible either use an interactive shell (or some other mechanism) to make the userâs environment available?â.
Well this has been tried (asking ansible to add -i in sudo runs) in the
past. However, many side effects came up (some ansible runs were stuck)
so the patch has been reverted since.
The best way to handle is is probably to write rbenv/rvm modules.