Check for the value of the use_sudo flag before using it to install gems

This relates with this issue: https://github.com/brightbox/brightbox-deployment/issues/6