We present the design, fabrication and feedback control of an earthworm-inspired multi-material multi-actuator soft robot capable of locomoting inside pipes. The bodies of natural earthworms are composed of repeated deformable structural units, called metameres, that generate the peristaltic body motions required for limbless underground burrowing and above-ground crawling. In an earthworm, each individual metamere is actuated by circular and longitudinal muscles that are activated synchronously by the animal's nervous system. Here, adopting the basic functional principles of metameric worms, we propose a new pneumatically-driven soft robotic system that mimics the motions and replicates the functionality of a single burrowing earthworm's segment. The suitability of the proposed approach is demonstrated experimentally through three basic locomotion tests: horizontal motion, vertical motion and oblique motion inside a varying-slope transparent pipe.