It is possible for it to be liver related but if it is your actual ribs and not something inside or behind the ribs I would hesistate to think that. If it is a liver problem, you are going to quickly go from a but sore to a dire situation and it will only get worse the longer you wait to get treatment.
A good way to kind of rule out this problem is to press on the area just below your ribs on the right side, if there is no pain, it probably isn't organ related.
You may have an intercostal bruise where the area between the ribs is swollen and hurting or it could be a fractured rib. Have you been coughing alot or playing any rough sports? It could just be a contusion but in any case, no one here can diagnose you, you need to visit your family doc and see what they think.