Upgrading to rails 4 and fixing gems