Gas pumps will sometimes work after hours even if a clerk isn’t on duty. Same with other self service situations where a card might be your only payment option. Carrying cash is a last resort; you risk losing it or not having enough.
actually this isn't true - i was in Seattle and there's at least one cashless Starbucks and one restaurant (Kati Vegan Thai); when i asked at both places they patiently explained that they couldn't accept cash at either one.