Shopify CLI theme dev error

Topic summary

Local theme development on Windows 11 (22H2) with Shopify CLI fails when running “shopify theme dev” on the Dawn theme. An error appears (screenshot provided); the linked GitHub issue indicates it’s the “ruby: invalid switch -e” problem.

Environment reported:

  • Ruby 3.0.6, Gem 3.2.33, Bundler 2.4.10
  • Git 2.38.1.windows.1
  • Node v18.15.0, NPM 9.6.3
  • Shopify CLI 3.45.0

Tried workaround: setting the environment variable SHOPIFY_CLI_BUNDLED_THEME_CLI=1 before running commands. Result: no change; the same error persists.

Official guidance: use the Shopify CLI GitHub issues board for support. The OP linked a specific issue for reference: Issue #1851 (“Shopify theme commands fail → ruby: invalid switch -e”).

Status: no fix provided within this thread. Resolution is deferred to the GitHub issue; follow that thread for updates or patches. The screenshot and the linked GitHub issue are central to understanding and tracking the problem.

Summarized with AI on January 28. AI used: gpt-5.

I’m trying to develop Shopify themes locally on Windows 11 22H2. I’ve installed all dependencies and cloned Dawn to my laptop. Versions according to command prompt are:

  • Ruby: ruby 3.0.6p216 (2023-03-30 revision 23a532679b) [x64-mingw32]
  • Gem: 3.2.33
  • Bundler: Bundler version 2.4.10
  • Git: git version 2.38.1.windows.1
  • Node: v18.15.0
  • NPM: 9.6.3
  • Shopify: Current Shopify CLI version: 3.45.0

When running “shopify theme dev” in the Dawn directory, I get this error:

Any help is much appreciated!!

1 Like

Try running “set SHOPIFY_CLI_BUNDLED_THEME_CLI=1” first. After that, you can run your Shopify commands normally throughout the CMD session.

2 Likes

I tried this but I still get the same error :disappointed_face:

Hi @cobyambrose ,

The official place for support questions relating to the Shopify CLI is the Public GitHub repository issue board:

https://github.com/Shopify/cli/issues

Hope you have a great day

1 Like

For reference purposes to leave a trail for other people with this issue: Shopify theme commands fail → ruby: invalid switch -e · Issue #1851 · Shopify/cli (github.com)