The problem is obtaining enough energy per cubic metre-second, so to speak--over the next 5 billion years, the sun will provide the earth with enough power to do just about anything we'd like to do today. But the reason we don't recycle rare earth metals is because it takes a lot of concentrated energy that we'd rather use for other things.
This problem will only become worse as concentrated energy sources are used up, and we move on to more diffuse sources with lower EROEIs, but expect to have the same surplusses we had in the 1990s.
According to "Sustainable Energy without the Hot Air" Thorium will last a while. A few hundred years should be possible. That should be plenty of time to develop nuclear fusion.
Hmmm. Fusion. Even if sustainable ignition is made to work, and a perfectly functioning fusion reactor can be built - it's still completely unknown if it can be used as a useful power station:
Anyone interested in fusion power really ought to read that article. The main thrust of the article is: a) even if you build the reactor, how do you capture the energy - which is mostly emitted in the form of neutrons - and b) where are you going to get the tritium from. Currently the answer to both questions is 'don't know'.
This problem will only become worse as concentrated energy sources are used up, and we move on to more diffuse sources with lower EROEIs, but expect to have the same surplusses we had in the 1990s.