Home > OS >  Shopify CLI: Best way to update Ruby for Shopify on OSX 11?
Shopify CLI: Best way to update Ruby for Shopify on OSX 11?

Time:02-20

PROBLEM

While pulling theme changes, I see a warning the "environment Ruby version is outside of the range supported by the CLI".

  • Shopify CLI 2.11.2
  • Ruby 2.6.3
  • Homebrew 3.3.15
  • Mac OSX 11.6.1

THINGS TRIED

  1. Googling has revealed many conflicting (and out-of-date) answers about how to update Ruby on OSX.
  2. Have been through all 11 pages of this extensive guide but can't find basic, 1-2-3 instructions for how to switch to Homebrew Ruby without a version manager: Install Ruby 3.1 · macOS (is it really this complex?)
  3. Have also updated Brew/Shopify CLI and also tried updating Ruby via Brew using...

$ brew upgrade ruby

But saw another warning...

Warning: ruby 3.1.0 already installed

So assume the OSX version of Ruby is overriding the brew version? Not sure, I have zero Ruby knowledge sorry.


QUESTIONS

  1. What's best Ruby setup (and way to update Ruby) specifically for use with Shopify CLI on OSX 11 - especially when you don't do any other Ruby development?

Any help or suggestions welcome. Cheers

CodePudding user response:

Switching to Homebrew Ruby requires you update the PATH environment variable (zsh shell in OSX11 instead of bash) by running...

$ echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.zshrc

I still see a Shopify warning that Ruby 3.1.0 is outside the range supported by the CLI but assume that's a Shopify issue because this page states a requirement of Ruby 2.7 .

  • Related