When calculating the increase in hp, you must take the reciprocal of both numbers.
p ruby: 1/38
and
jah: 1/50
Then expand both numbers:
p ruby: 50*1/38 = 50/1900
and
jah: 38*1/50 = 38/1900
Now we obviously see that 50/1900 > 37/1900

p ruby is better as long as you have 1900 or more base hp.
Vouch, therefore perfect ruby in a shield gives more life.