But once you reach that level of scale you have (or should have!) the resources to redevelop services that are holding you back. Not choosing Rails because you intend some day to get to Twitter scale smells of premature optimisation. (Twitter themselves used Ruby!)
I would argue that there isn’t a framework in existence that is actually built to cleanly scale to the size of any of those companies. If there is one that claims to, it is probably lying.
I have had to help scale a large scale Rails app and break it apart about 5 years ago. 500k requests per minute. That was tough. A lot of the features that Shopify and Github have upstreamed since then would have helped a lot and to be honest it is a lot easier to scale now with Rails because of those upstreamed features. Like multiple databases, viewcomponents, etc.