Cant run some shopify commands due to an error about ruby version incompatibility

I am new to shopify CLI and trying to run shopify theme pull or shopify theme serve but cannot due to an error I keep on running into

PS C:\Users\Russell\shopify\shopifyApp\starter> shopify theme serve
Your environment Ruby version, 3.1.1, is outside of the range supported by the CLI, 2.6.6..<3.1.0, and might cause incompatibility issues.
X An unexpected error occured.
        To submit an issue include the stack trace.
        To print the stack trace, add the environment variable SHOPIFY_CLI_STACKTRACE=1.

ive tried to downgrage ruby to 3.1.1 using gem update --system 3.1.1 but get this in my cmd

C:\Users\Russell>gem update --system 3.1.1
ERROR:  rubygems 3.1.1 is not supported on 3.1.1. The oldest version supported by this ruby is 3.3.3

im using windows 10 and ruby 3.3.3

1 Like