A while isn't a thing that can be ridden on.
One of the following sentences is nonsensical. Which one is it?

a. "i was riding on the back of a friend's while"
b. "i was riding on the back of a friend's bicycle"