Shopify CLI errors - cannot log in

Topic summary

Shopify CLI login fails after previously working pre-BFCM (Black Friday/Cyber Monday). Running “shopify login” returns: “An unexpected error occurred,” suggesting setting the environment variable SHOPIFY_CLI_STACKTRACE=1 to print a stack trace.

Attempting “shopify help” instead surfaces a LoadError indicating a missing Ruby dynamic library: libruby.3.1.dylib. The error lists multiple searched paths (including /usr/local/opt/ruby and a Homebrew Ruby 3.3.4 path), implying a Ruby version mismatch or missing Ruby 3.1 runtime.

Details shown: Shopify CLI 2.15.2; gems referenced include racc 1.6.0 and nokogiri 1.13.3; stack trace points into shopify-cli and CLI Kit libraries. A note states: “You cannot use gems with Shopify CLI.”

Key needs/open questions:

  • How to properly enable and capture the full stack trace via SHOPIFY_CLI_STACKTRACE=1.
  • How to resolve the Ruby dependency mismatch (install or link the required Ruby 3.1 library vs current Ruby setup).

Status: No resolution yet. Logs/stack trace output are central to diagnosing the issue.

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

Hi, my shopify CLI was working fine before BFCM, but today I’m attempting to login, and I get this error:

$ shopify login
✗ 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.

I’m not sure how to print the stack trace as it asks as there’s no additional messages logged to the command line. However, when I attempted to run shopify help, I got this:

Use shopify help <command> to display detailed information about a specific command.

app: Suite of commands for developing apps. See shopify app <command> --help for usage of each command.
  Usage: shopify app [ connect | create | deploy | open | serve | tunnel ]

[Note] You cannot use gems with Shopify CLI.
[LoadError] dlopen(/usr/local/Cellar/shopify-cli/2.15.2/gems/racc-1.6.0/lib/racc/cparse.bundle, 0x0009): Library not loaded: /usr/local/opt/ruby/lib/libruby.3.1.dylib
  Referenced from: <3140F244-93FA-3510-BC69-A87E3B67A69A> /usr/local/Cellar/shopify-cli/2.15.2/gems/racc-1.6.0/lib/racc/cparse.bundle
  Reason: tried: '/usr/local/opt/ruby/lib/libruby.3.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/ruby/lib/libruby.3.1.dylib' (no such file), '/usr/local/opt/ruby/lib/libruby.3.1.dylib' (no such file), '/usr/local/lib/libruby.3.1.dylib' (no such file), '/usr/lib/libruby.3.1.dylib' (no such file, not in dyld cache), '/usr/local/Cellar/ruby/3.3.4/lib/libruby.3.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/Cellar/ruby/3.3.4/lib/libruby.3.1.dylib' (no such file), '/usr/local/Cellar/ruby/3.3.4/lib/libruby.3.1.dylib' (no such file), '/usr/local/lib/libruby.3.1.dylib' (no such file), '/usr/lib/libruby.3.1.dylib' (no such file, not in dyld cache) - /usr/local/Cellar/shopify-cli/2.15.2/gems/racc-1.6.0/lib/racc/cparse.bundle
       They are disabled.
       Please don't modify the CLI locally.
       If you would like to contribute to the CLI project, please refer to
       https://github.com/Shopify/shopify-cli/blob/main/.github/CONTRIBUTING.md

Ignoring ffi-1.15.5 because its extensions are not built. Try: gem pristine ffi --version 1.15.5
Ignoring racc-1.6.0 because its extensions are not built. Try: gem pristine racc --version 1.6.0
Ignoring shopify-cli-2.15.2 because its extensions are not built. Try: gem pristine shopify-cli --version 2.15.2
The Nokogiri gem is failing to load, due to an installation or architecture issue.

To fix this, reinstall Nokogiri.

• Installation guide: https://nokogiri.org/tutorials/installing_nokogiri.html

<internal:/usr/local/Cellar/ruby/3.3.4/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require': cannot load such file -- nokogiri/nokogiri (LoadError)
	from <internal:/usr/local/Cellar/ruby/3.3.4/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/bin/shopify:9:in `require'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/nokogiri-1.13.3-x86_64-darwin/lib/nokogiri/extension.rb:30:in `rescue in <top (required)>'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/nokogiri-1.13.3-x86_64-darwin/lib/nokogiri/extension.rb:4:in `<top (required)>'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/nokogiri-1.13.3-x86_64-darwin/lib/nokogiri.rb:10:in `require_relative'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/nokogiri-1.13.3-x86_64-darwin/lib/nokogiri.rb:10:in `<top (required)>'
	from <internal:/usr/local/Cellar/ruby/3.3.4/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
	from <internal:/usr/local/Cellar/ruby/3.3.4/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/bin/shopify:9:in `require'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/theme-check-1.10.2/lib/theme_check/html_visitor.rb:2:in `<top (required)>'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/theme-check-1.10.2/lib/theme_check.rb:45:in `require_relative'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/theme-check-1.10.2/lib/theme_check.rb:45:in `<top (required)>'
	from <internal:/usr/local/Cellar/ruby/3.3.4/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
	from <internal:/usr/local/Cellar/ruby/3.3.4/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/bin/shopify:9:in `require'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/project_types/extension/commands/check.rb:2:in `<top (required)>'
	from <internal:/usr/local/Cellar/ruby/3.3.4/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
	from <internal:/usr/local/Cellar/ruby/3.3.4/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/bin/shopify:9:in `require'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/command.rb:63:in `const_get'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/command.rb:63:in `block in subcommand'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/command_registry.rb:87:in `resolve_class'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/command_registry.rb:31:in `block in resolved_commands'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/command_registry.rb:30:in `each'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/command_registry.rb:30:in `each_with_object'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/command_registry.rb:30:in `resolved_commands'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/command/project_command.rb:22:in `available_subcommands'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/command/project_command.rb:14:in `help'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/commands/help.rb:30:in `block in call'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/commands/help.rb:28:in `each'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/commands/help.rb:28:in `call'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/command.rb:35:in `call'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/core/executor.rb:17:in `block (2 levels) in call'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/executor.rb:37:in `block (2 levels) in with_logging'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-ui/lib/cli/ui/stdout_router.rb:169:in `with_id'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/executor.rb:36:in `block in with_logging'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-ui/lib/cli/ui.rb:176:in `log_output_to'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/executor.rb:35:in `with_logging'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/core/executor.rb:16:in `block in call'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/executor.rb:45:in `block (2 levels) in with_traps'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/executor.rb:55:in `twrap'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/executor.rb:44:in `block in with_traps'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/executor.rb:55:in `twrap'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/executor.rb:43:in `with_traps'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/core/executor.rb:15:in `call'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/core/entry_point.rb:24:in `block in call'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/core/monorail.rb:26:in `log'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/core/entry_point.rb:23:in `call'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/bin/shopify:50:in `block (2 levels) in <top (required)>'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb:75:in `handle_abort'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb:21:in `call'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/bin/shopify:49:in `block in <top (required)>'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/bin/shopify:59:in `<top (required)>'
	from /usr/local/bin/shopify:7:in `load'
	from /usr/local/bin/shopify:7:in `<main>'
/usr/local/Cellar/shopify-cli/2.15.2/gems/nokogiri-1.13.3-x86_64-darwin/lib/nokogiri/extension.rb:7:in `require_relative': cannot load such file -- /usr/local/Cellar/shopify-cli/2.15.2/gems/nokogiri-1.13.3-x86_64-darwin/lib/nokogiri/3.3/nokogiri (LoadError)
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/nokogiri-1.13.3-x86_64-darwin/lib/nokogiri/extension.rb:7:in `<top (required)>'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/nokogiri-1.13.3-x86_64-darwin/lib/nokogiri.rb:10:in `require_relative'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/nokogiri-1.13.3-x86_64-darwin/lib/nokogiri.rb:10:in `<top (required)>'
	from <internal:/usr/local/Cellar/ruby/3.3.4/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
	from <internal:/usr/local/Cellar/ruby/3.3.4/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/bin/shopify:9:in `require'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/theme-check-1.10.2/lib/theme_check/html_visitor.rb:2:in `<top (required)>'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/theme-check-1.10.2/lib/theme_check.rb:45:in `require_relative'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/theme-check-1.10.2/lib/theme_check.rb:45:in `<top (required)>'
	from <internal:/usr/local/Cellar/ruby/3.3.4/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
	from <internal:/usr/local/Cellar/ruby/3.3.4/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/bin/shopify:9:in `require'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/project_types/extension/commands/check.rb:2:in `<top (required)>'
	from <internal:/usr/local/Cellar/ruby/3.3.4/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
	from <internal:/usr/local/Cellar/ruby/3.3.4/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/bin/shopify:9:in `require'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/command.rb:63:in `const_get'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/command.rb:63:in `block in subcommand'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/command_registry.rb:87:in `resolve_class'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/command_registry.rb:31:in `block in resolved_commands'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/command_registry.rb:30:in `each'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/command_registry.rb:30:in `each_with_object'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/command_registry.rb:30:in `resolved_commands'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/command/project_command.rb:22:in `available_subcommands'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/command/project_command.rb:14:in `help'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/commands/help.rb:30:in `block in call'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/commands/help.rb:28:in `each'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/commands/help.rb:28:in `call'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/command.rb:35:in `call'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/core/executor.rb:17:in `block (2 levels) in call'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/executor.rb:37:in `block (2 levels) in with_logging'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-ui/lib/cli/ui/stdout_router.rb:169:in `with_id'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/executor.rb:36:in `block in with_logging'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-ui/lib/cli/ui.rb:176:in `log_output_to'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/executor.rb:35:in `with_logging'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/core/executor.rb:16:in `block in call'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/executor.rb:45:in `block (2 levels) in with_traps'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/executor.rb:55:in `twrap'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/executor.rb:44:in `block in with_traps'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/executor.rb:55:in `twrap'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/executor.rb:43:in `with_traps'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/core/executor.rb:15:in `call'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/core/entry_point.rb:24:in `block in call'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/core/monorail.rb:26:in `log'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/lib/shopify_cli/core/entry_point.rb:23:in `call'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/bin/shopify:50:in `block (2 levels) in <top (required)>'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb:75:in `handle_abort'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb:21:in `call'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/bin/shopify:49:in `block in <top (required)>'
	from /usr/local/Cellar/shopify-cli/2.15.2/gems/shopify-cli-2.15.2/bin/shopify:59:in `<top (required)>'
	from /usr/local/bin/shopify:7:in `load'
	from /usr/local/bin/shopify:7:in `<main>'
✗ 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.

I’m pretty sure I haven’t touched any Ruby versions or Ruby gems on this machine since before it was working fine. FYI, my machine is on:
ruby 3.3.4 (2024-07-09 revision be1089c8ec) [x86_64-darwin23]

I did recently update to Tahoe on MacOS.

1 Like

This was mostly it. I realized that I had already been using the Node version before, but somehow they collided after the update. Had do to a lot of cleanup first:

  1. Update homebrew with brew update-reset
  2. Uninstall the old CLI with brew uninstall shopify-cli
  3. Re-install the latest Node version of the CLI with npm install -g @shopify/cli

After that, I finally get the warning/reminder that “shopify login is deprecated did I mean shopify auth login?”. Indeed I did.