Time divided by Effort multiplied by Awareness squared equals Improvement. Translation: thirty, forty-five minutes of mad pedaling per week isn't going to improve your cycling much. What will improve your cycling, and surprisingly rapidly, is a regimen of, at least twice a week, three to four hours of steady, easy spinning with total awareness of what you're doing and how you're doing it. Treat your body gently and give it a steady diet of conscious exercise and your ability level will shoot up like corn under a hot July sun. Try to beat it into shape and all you'll get is a beat-up body and a spirit that rebels at the thought of going for a bike ride.
If just "getting in shape" is your goal, it probably doesn't make much difference whether you ride a stationary bike in a gym or ride a real bike on the road, other than that the former is about as much fun as clipping toenails. Which is exactly the great attraction of cycling; it's just plain fun as hell. Yet for unknown reasons, an awful lot of cyclists seem to forget the fun factor and instead get stuck in the pain. Then they wonder why they never seem to improve. Why is simple. Their minds may be thinking about rainbows at the other end of their tunnels of torture but all the bodies know is the torture.
For sure hurting at times is the reality but there's a world of difference between the pains of muscles used and gently challenged and the pain of muscles thoroughly abused. For example, say you feel ready to attack a good climb, maybe a 700 vertical meter jaunt to a pass in the mountains. If you're part of the damn-the-muscles, full-speed-ahead school, you'll drive to the base of the climb, jump on the bike, and start jamming up the mountain with one eye on the watch to see how long it takes. The opposite approach, the ride gently school of thought, will park the car maybe an hour's pedal away from the base of the climb, then comfortably spin up the valley, increasing speed only as the muscles are ready. By the time the base of the climb appears, muscles will be nicely toasted with a fine rhythm established and the climb is taken smoothly and surely.
The objective is to ride just inside the limits of your strength with occasional surges beyond those limits when you feel like extending yourself. How do you know where those limits are and how long you can exceed them? By listening to your legs; they'll tell you clearly and forcefully what you can do and when it's time to back off. The trick is recognizing when that voice is truly your legs' and not your mind's ego sounding off or the moaning of the latent couch potato whining about being too tired today.
The hardest part in undertaking a regimen to gain strength and durability is the getting going. This is where you can find yourself having to be firm when what you're really feeling is the desire to wait for a better day. It's a bit like getting the old british sports car going when the engine is cold and cranky, the transmission stiff and unyielding, and the wheels seemingly stuck to the asphalt. You just have to stay with it, adjust the choke gently, give the oil lots of time to warm up, then drive off slowly while studiously ignoring all the creaks and groans of protest emanating from suspension members and body parts. After a bit, everything settles down into their respective roles and soon the car and you are humming down the road in perfect concert.
On a bike, it's your body parts doing the creaking and groaning and your muscles who are balky and stiff. Whether you're truly on for a ride or not won't be discovered for at least half an hour. The older you are, the longer it seems to take to find that sweet rhythm that can sweep you over the countryside in remarkably easy fashion so don't worry if the first hour's going is a bit rough. Just stay in low gears that let you spin easily and while you're waiting, enjoy the views.
If the countryside your pedaling through doesn't gladden your heart, you chose the wrong place to ride. For example if the route you've selected has you tight-roping down the edge while a stream of howling steel rushes past harrowingly close, you're probably going to be as relaxed as a cat trapped between a river and a dog with an attitude. This is supposed to be fun, not a course in seeing how stressed you can twist your mind.
So get out the maps and find a circuit of small roads with little to no traffic,wandering through some picturesque, or at least tranquil, countryside. If you have to drive to get there, do it. Forget the purists who will stare at you with horror at the idea of driving with your bike somewhere pleasant to ride; your objective is relaxing on your bike and if not driving somewhere means tying your shoulder and neck muscles in knots of tension while negotiating the shooting galleries of suburbia, then drive. You'll feel better, you'll be way more relaxed, and your cycling will improve in leaps and bounds.