The room temperature ferromagnetism (RTFM) of the undoped, N doped, Ru doped ,and Ru-N codoped anatase TiO2 nanotubes (TNTs) films are investigated combined with experiments and first principles approaches. The experiments are highly consistent with the theory calculations. All samples display anatase structures and ferromagnetism at room temperature. The values of the saturation magnetization (Ms) of undoped TiO2, N doped TiO2, Ru doped TiO2, and Ru-N codoped TiO2, respectively, are 0.065 emu/g, 0.015 emu/g, 0.155 emu/g, and 0.073 emu/g. The calculated net moment is in the order of Ru doped > Ru-N codoped > undoped > N doped. The oxygen vacancies play an important role in RTFM of TNTs. Moreover, the hybridization of Ru 4d, N 2p, and O 2p led to the spin-spilt of Ru 4d, N 2p, and O 2p which is devoted to the system magnetism.