> There will come a time when there is no more oil in the ground that is economic to extract.
The qualifier about needing to be economic is really important here. We will never really run out of oil, but we might run out of cheap oil.
As market prices for oil rise, more and more alternative ways to get at it become economical. Shale oil was one example of this process. (Another one is to create something like oil from coal. The Germans did a lot of this kind of thing in WW2, because they had access to plenty of coal, but were short on oil. Similarly, world coal reserves seem to be much larger than oil reserves.)
However, renewables are getting better and better and thus prevent energy prices from rising as fast as the cost of oil extraction will increase.
Thus eventually making oil uncompetitive, as you say.