What does here's the rub mean?
A rub is a difficulty.
The origin is unknown and it is most known for Shakespeare's use
of it in Hamlet....
"To sleep: perchance to dream: ay there's the rub; for in that
sleep of death what dreams may come when we have shuffled off this
mortal coil, must give us pause;"
In Shakespeare's time a rub was an area of rough, or
uneven ground, one might encounter while attempting to play a game
of bowls (a popular game in the Elizabethan era, as the famous
account of Sir Francis Drake's game of bowls confirms).
A rub was a problematic patch of turf that would sabotage or
deflect ones attempt to roll the bowl with accuracy. Thus in
Shakespeare's usage in Hamlet's soliloquy it means, the centre or
source of the problem, that knotty or disagreeable fact or reality,
that makes a problem a problem.
In the speech Hamlet is contemplating suicide. And he is
inclined to take his own life, due to the sleep -- the eternal rest
from his suffering -- that doing so would grant him. But what
"dreams" will come to him in such a sleep? i.e. Might there be an
afterlife that will have to be encountered if he kills himself, and
if so, what is its character?
The thought of this possibility stays his hand from taking his
life, it is the source of the problem that is preventing him from
going down a route his will initially wanted to take him. Hence,
"ay there's the rub."