fixed some config issues with pg and explicitly stated gem version for pg as well as ruby version. This helps eliminate some install issues and incompatabilites between ruby 2.1 and the gems. Fixed some paths in idea controller which were not being checked for existence before being used.