Cannot use RVM-installed Ruby with sudo

Use rvmsudo command instead of sudo


Taking @calas' answer one step further, add this to your ~/.bashrc:

alias sudo=rvmsudo

This avoids the requirement of having to remember to change sudo to rvmsudo for every command (particularly annoying for copy/pasted commands).