He's probably rubbing because its stuck so you have to get a papertowel and get it off. If not he will continue to rub, cause irritation which will inturn, make it more difficult for him to have a bowel movement. Once you get it off, see how he does. If he's still having difficulty going then a vet visit may be needed.
Let me know if you have any other questions
Good Luck &
Best Fishes