X-ray diffraction with photon energies near the Ru L2-absorption edge was used to detect resonant reflections characteristic of a G-type superstructure in RuSr2GdCu2O8 single crystals. A polarization analysis confirms that these reflections are due to magnetic order of Ru moments, and the azimuthal-angle dependence of the scattering amplitude reveals that the moments lie along a low-symmetry axis with substantial components parallel and perpendicular to the RuO2 layers. Complemented by susceptibility data and a symmetry analysis of the magnetic structure, these results reconcile many of the apparently contradictory findings reported in the literature.