Update gemfile for deployments
simplify code and fix huge memory leak