Casting the spell requires taking damage
The PHB section on reactions states (202),
Some spells can be cast as reactions. These spells take a fraction of a second to bring about and are cast in response to some event. If a spell can be cast as a reaction, the spell description tells you exactly when you can do so.
Therefore, you only get to cast the spell when the description says you can. In the case of Hellish Rebuke, that requires you to take damage from a creature within range.
It is possible to store the spell and use it as a reaction later
The Ring of Spell Storing states,
Any creature can cast a spell of 1st through 5th level into the ring by touching the ring as the spell is cast.
It does not specify any other limits on casting the spell, such as duration, so you can choose to put your Hellish Rebuke spell into the ring by touching it as you cast it (right after you take damage).
Later, it states,
While wearing this ring, you can cast any spell stored in it. The spell uses the slot level, spell save DC, spell attack bonus, and spellcasting ability of the original caster, but is otherwise treated as if you cast the spell.
This gives a specific list of which properties of the spell come from the original caster, and which come from you. Since the list does not contain triggering conditions, those triggering conditions are "treated as if you cast the spell"; that is, you can cast the spell as a reaction, as written.
Generally, you must meet the conditions for casting the spell twice: it specifically says you cast the spell both for storing the spell and using the stored spell.