I was using per-user rbenv so sudo made it not work. We should document the recommended way to install ruby on the inception VM (which may be the way bosh-bootstrap does it). Some kind of detection sounds good.

I've always run this script as a regular user. It seems like everything that needs sudo will sudo.