There has been much debate about Ruby's motives. He claimed that he killed Oswald in order to save [Jacqueline Kennedy]? from testifying in a murder trial. Other people suggest that he was carrying out a Mafia "hit," or that he was part of a conspiracy to assassinate the president, and silenced Oswald to prevent him from testifying.
Ruby was tried and convicted for Oswald's murder, but the conviction was overturned on procedural grounds. He died of cancer in prison before he could be re-tried.