Contrary to some rumors, Riolu cannot evolve using a Sun Ribbon in any Pokémon game. The correct evolution method for Riolu into Lucario is:
Friendship can be increased by walking with Riolu in your party, giving it vitamins, using it in battles, and keeping it from fainting. Once its friendship is high enough (typically 220+), leveling it up during the day (between 4:00 AM and 8:00 PM in most games) will trigger evolution into Lucario.
The Sun Ribbon is an item that appears in some games but has no effect on Riolu's evolution.