Straight Base64 isn't URL-safe. Check out `Base64.urlsafe_encode64`.