PG::UndefinedTable: ERROR: relation "pg_range" does not exist

According to that SO link you either have an old or corrupt database.