X-ray diffraction with photon energies near the Ru L$_2$-absorption edge was used to detect resonant reflections characteristic of a G-type superstructure in RuSr$_2$GdCu$_2$O$_8$ 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 RuO$_2$ 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.