Shopify CLI v3.x Windows/Ruby issues

Topic summary

Users encounter issues running Shopify CLI v3.x on Windows, particularly with commands that invoke bundle exec, which either stall indefinitely or produce gem-related errors.

Primary Problem:

  • Commands like shopify theme dev and shopify theme pull hang during execution at bundle exec steps
  • Error messages indicate shopify-cli gem cannot be found or is not included in the bundle
  • The shopify-cli gem on RubyGems.org only shows versions up to 2.34, creating confusion about v3.x compatibility

Working Solution:
One user resolved the issue by:

  • Completely uninstalling and reinstalling Ruby for Windows
  • Creating a fresh theme directory
  • Skipping the standard Bundler setup steps from bundler.io, as bundle install runs automatically within Shopify CLI scripts

Additional Recommendations:

  • Use RubyInstaller with MSYS2 and run ridk install for development tools
  • Verify Ruby’s bin folder is in system PATH
  • Update SSL certificates if connection errors occur
  • Consider using WSL (Windows Subsystem for Linux) as an alternative to avoid Windows-Ruby compatibility issues entirely

The discussion remains open with multiple users confirming the reinstallation approach works.

Summarized with AI on October 28. AI used: claude-sonnet-4-5-20250929.

I am trying to follow the documentation and recommended tools and install process for the Shopify CLI on Windows at https://shopify.dev/themes/tools/cli/install

I am showing in my CMD prompt that I have:

Node: 18.12.1

NPM: 9.4.0

Ruby: 3.1.3p185

Bundler: 2.4.5

Shopify CLI: 3.37.0

Some of my Shopify CLI commands work as expected, but others such as “shopify theme dev” seem to stall without giving an error. Running in verbose mode, I see that all of the stalling occurs around “bundle exec” lines in the script, for example:

bundle exec shopify theme serve . --theme mytheme --live-reload hot-reload

Running this line directly in my CLI gives me the error:

C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.4.5/lib/bundler/rubygems_integration.rb:304:in `block in replace_bin_path': can't find executable shopify for gem shopify-cli. shopify-cli is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception)
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.4.5/lib/bundler/rubygems_integration.rb:332:in `block in replace_bin_path'

I have tried adding shopify-cli to my Gemfile, however, it does not appear to be available beyond 2.34, as indicated at https://rubygems.org/gems/shopify-cli

This would seem to indicate that any syntax specific to version 3.x of the CLI cannot be run by Bundler until the Gem is updated. Would there be another way to address this for my Windows build?

I have cleaned up some packages so Bundler appears to be running version 3.38.0 of Shopify CLI, however, I am continuing to have the CLI stall on some commands, for example:

Command:

shopify theme pull -d --verbose

Result: Execution stalls at

2023-01-26T23:32:58.863Z:
Running system process:
  · Command: bundle exec shopify theme pull c:/xampp/htdocs/mydir --development
  · Working directory: c:\xampp\htdocs\mydir

and

Command:

shopify theme dev -t mytheme --verbose

Result: Execution stalls on:

2023-01-26T23:36:28.378Z:
Running system process:
  · Command: bundle exec shopify theme serve . --theme mytheme --live-reload hot-reload
  · Working directory: c:\xampp\htdocs\mydir

Thanks for any guidance on why these Bundler commands are stalling and advice on how to resolve them.

I have resolved the issue by uninstalling/reinstalling Ruby for Windows, starting a new directory for my theme setup, and skipping the install steps under Getting Started at https://bundler.io/. These steps do not appear necessary and appear to possibly create conflicts since “bundle install” appears to be executed automatically in the Shopify CLI scripts.

1 Like

Thank you so much ? :folded_hands: ,
I tried dozens of suggestions for 2 days, but only your solution worked. I never thought it was as simple as that.

Looks like a compatibility issue with Bundler and Shopify CLI. Debugging this is like timing window cleaning services on a sunny day try npx shopify or check for Gem updates.

**Common Issues with Shopify CLI v3.x on Windows (Ruby-based versions)**1. Ruby Installation Problems

  • Shopify CLI v3.x depends on a specific Ruby version.

  • Windows lacks a native UNIX environment, so tools like ridk, msys2, or WSL may be needed.

Fix:

  • Use RubyInstaller for Windows with MSYS2.

  • Run ridk install after installing Ruby to get necessary dev tools.

  1. Gem Installation Fails

    • Errors like mkmf.rb can’t find header files for ruby during gem install.

    Fix:

    • Ensure devkit is installed (via ridk install).

    • Use gem install <gem_name> --platform=ruby to avoid native extension errors.

  2. Shopify CLI Not Detected

    • After gem install shopify-cli, the command is not recognized.

    Fix:

    • Add Ruby’s bin folder to your PATH. Typically:
      C:\RubyXX\bin and C:\RubyXX\lib\ruby\gems\X.X.X\bin
  3. Permission or SSL Issues

    • Errors like SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed.

    Fix:

    • Update Ruby’s SSL certificates:

      sh

      CopyEdit

      gem install ssl_certs ssl_certs update

  4. WSL Alternative Recommended

    • Many Shopify developers use WSL (Windows Subsystem for Linux) to bypass these Windows-Ruby compatibility issues entirely.

    Fix:

    • Install WSL and Ubuntu.

    • Install Ruby, Node.js, and Shopify CLI in the Linux shell.

Download Now