Alternatively, hire people because of their intrinsic competency and not because they check the "X years of experience in Rails" box. Hire people who can pick up new languages easily
Most companies don't do that in my experience. It'd have been easier to get hired over the years if they did.
It's always been a non-issue for me. However, when I do want to explore a new stack I generally go as a consultant or in a small startup i.e. not-well-funded. I'm more than willing to pay the price in wage for a few shorter-term engagements.
Ever since I'm a data analyst, I found that career happiness is more important than wages depending where someone is on the career happiness track. Software engineering is just a bit too much for me. Where I work now as a data a data analyst, keeps me sane. It's the diversity and variety of tasks that I like.