Adding automated AMI generation to EC2 with Ruby server start up script

Hmmmmm...yeah, something is not happening as intended at line 36. You shouldn't need all the subsequent sudo calls. The only thing I expected to see in the if statement was the creation of the gem so that you'd be able to install the service.