Devices resident in the stomach-used for a variety of clinical applications including nutritional modulation for bariatrics, ingestible electronics for diagnosis and monitoring, and gastric-retentive dosage forms for prolonged drug delivery-typically incorporate elastic polymers to compress the devices during delivery through the oesophagus and other narrow orifices in the digestive system. However, in the event of accidental device fracture or migration, the non-degradable nature of these materials risks intestinal obstruction. Here, we show that an elastic, pH-responsive supramolecular gel remains stable and elastic in the acidic environment of the stomach but can be dissolved in the neutral-pH environment of the small and large intestines. In a large animal model, prototype devices with these materials as the key component demonstrated prolonged gastric retention and safe passage. These enteric elastomers should increase the safety profile for a wide range of gastric-retentive devices.