Rails didnt have the pressure to be a $45 million dollar company (investors expect a 5x return don't they?).
Although, thats what Google paid for Android.
$9M was the total raise, not the valuation. Presumably the exit would have to be much higher than $45M for a 5x multiple.
I don't have any information on the details of this deal but if it is a typical series A then that 9 million represents a 20-30% equity stake in the company. This means for a 10x return for investorss the company needs to grow in value to ~$360 million.
Rails was developed internally and later released open source. It's a completely different model and your statement is ignorant.