Fixed issue connecting to the database in rails4