Currently, ISS (and, previously, MIR) had exercise machines modified/made for zero-G use, and a mandatory regime of use. Exercise suites and a similar compulsion to use them would seem to be a better value for money than building a track, given everything. Especially the risk of a derailment causing problems for everyone sleeping on board at the time...
Fiction (even hard-science fiction) often has rotating quarters on long-term deep-space missions, and I'm sure that something like that would be necessary (although I'm not sure if we're that good, yet, of leak-proofing the connection between rotating and non-rotating segments for such extended periods. I'd be tempted to make the whole craft rotating around its fore-back axis (and making sure that the resulting stresses were more than manageable, with a good tolerance) except for the difficulty in overcoming the gyroscopic effect when the facing direction needed to be changed, and perhaps an amount of Coriolis-based confusion by those on board.
I don't immediately know if The Voyager (from 2001 AD) method is having the living centrifuge within the air-sealed environment (or perhaps a low-pressure secondary hull, to make the air-seal engineering less problematic), but that might be the way.
But (however you do it) you can't really have an Apollo-diameter ship generating Earhlike, Mars-like or even Moon-like gravity without severe gradient effects, it has to have a bigger radius/arm-length. One reason you need more than just some refurbished (and flushed! ..and reinforced!) Shuttle External Fuel Tanks for living quarters, and one reason you need bigger components (or assemblies), one reason for the Moon base factories (whoah, back on topic? ...not for long).
But for the Moon, 1/6th g working seems good enough to me. Fairground-style g-increasing sleeping quarters may be the necessary answer (but I'm still dubious of certain mechanical breakdowns on the equipment being used) and could be sited completely within air-filled areas to avoid the revolving seal problem (or entered by a docking ring, while stationary, and disconnected to spinning up and reconnected once spun down after the good night's sleep... as, unlike the spacecraft, there's a nice solid planetoid beneath them to push and pull the rotational velocities against wile spinning up and down). And would not need to be anything as large/fast as space-borne solutions are to merely add (at an angle to the normal) gravity up to sufficient 'g' for health reasons. But I'd go for larger-and-slower to avoid the (perhaps get-used-to-able) angular effects.
Or stick with the exercise suites. More studies need to be done, I suspect. (Not that I've sought full access to the current space-studies, either but studies in 1/6th g really still need to be done on top of that to properly assess the differences between artificial-g in zero-z and artificial-g in low-g.)