Rails won the past. There's a lot of legacy in it that's impractical to replace, which guarantees a sizable community, which makes it viable for new projects, if not always ideal, for quite some time.
It's become what J2EE was when Rails was new. Decades from now, even if it's completely fallen out of favor for new development, there'll be people getting paid handsomely to maintain legacy Rails apps. It's won an important spot in history.
But technology moves on. And just as the Java stack dominant when Rails emerged has lost ground to Rails, other non-Java stacks, and even newer Java stacks, is wire likely Rails will lose ground to other Ruby and non-Ruby stacks.