CLI: shopify theme dev: Command failed with exit code 5: bundle install

I know there are a few posts that are similar to this but none of the solutions worked for me

  • Apple M1 Max

  • Sonoma 14.4.1 (23E224)

  • ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [arm64-darwin23]

I was working on a new Shopify App and I must have updated the CLI as yesterday when I came back to do some theme work I ran ‘shopify theme dev’ and I got an error saying CLI doesn’t support Ruby 2.6. So after a lot of effort I installed 3.3.0. But now I have this new error…

Running:
shopify theme dev

Gives me:

Error coming from bundle install

Command failed with exit code 5: bundle install
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.