I ride before the gym. Simple. In the winter that's usually a roller ride. I try not to reduce my bike volume to accommodate gym work. Instead I'll ride at recovery or endurance intensity if my legs are tired. I hit the gym twice a week. In summer I can ride to and from the gym, doing sprints on the way back.