Unable to download updated ruby for jekyll

I’ve tried to install Jekyll following this tutorial

For some reason I can’t get ruby to update to the correct version. Ruby is supposed to 3.1.1p18 but my ruby only updates to 2.6.3p62

I’ve tried uninstalling and reinstalling ruby but it doesn’t work. Does anyone have any suggestions/recommendations?