Rats are omnivores. The University of Michigan’s Animal Diversity Web classifies the Norway rat (Rattus norvegicus) with a primary diet of omnivore: it eats plant foods such as seeds, grains, roots, and fruit, and also animal foods including insects, birds, eggs, and other small vertebrates.
In cities they often live on discarded human food; in the wild their stomach contents commonly mix plant and animal items. That mixed diet—not plants alone or meat alone—is why common rats are omnivores rather than herbivores or carnivores.
Source: Animal Diversity Web (University of Michigan) — Rattus norvegicus (brown rat)