What was Jack Ruby's motive?

I've watched and read endless material about whether there was a second gunman or a government conspiracy or just a lone nutter. What I am yet to hear is a reason for Jack Ruby to shoot Oswald. To me that's the big mystery of the whole situation.