Why shopify login --store return error when trying to login using my terminal?

fyardlest
New Member
4 0 0

I am trying to create a new theme for my Shopify store I have followed some steps to set up everything, now I try to connect to the store using the following command: shopify login --store holly-side.myshopify.com/admin

 

The line above return the following error:


X An unexpected error occurred.
To submit an issue include the stack trace.

C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/vendor/deps/cli-kit/lib/cli/kit/system.rb:181:in `os': Could not determine OS from platform x64-mingw-ucrt (RuntimeError)
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/vendor/deps/cli-kit/lib/cli/kit/system.rb:211:in `resolve_path'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/vendor/deps/cli-kit/lib/cli/kit/system.rb:126:in `system'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/lib/shopify_cli/context.rb:438:in `system'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/lib/shopify_cli/context.rb:331:in `open_browser_url!'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/lib/shopify_cli/identity_auth.rb:136:in `open_browser_authentication'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/lib/shopify_cli/identity_auth.rb:132:in `initiate_authentication'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/lib/shopify_cli/identity_auth.rb:61:in `authenticate'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/lib/shopify_cli/commands/login.rb:33:in `call'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/lib/shopify_cli/command.rb:30:in `call'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/lib/shopify_cli/core/executor.rb:17:in `block (2 levels) in call'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/vendor/deps/cli-kit/lib/cli/kit/executor.rb:37:in `block (2 levels) in with_logging'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/vendor/deps/cli-ui/lib/cli/ui/stdout_router.rb:169:in
`with_id'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/vendor/deps/cli-kit/lib/cli/kit/executor.rb:36:in `block in with_logging'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/vendor/deps/cli-ui/lib/cli/ui.rb:176:in `log_output_to'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/vendor/deps/cli-kit/lib/cli/kit/executor.rb:35:in `with_logging'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/lib/shopify_cli/core/executor.rb:16:in `block in call' from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/vendor/deps/cli-kit/lib/cli/kit/executor.rb:45:in `block (2 levels) in with_traps'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/vendor/deps/cli-kit/lib/cli/kit/executor.rb:51:in `twrap'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/vendor/deps/cli-kit/lib/cli/kit/executor.rb:44:in `block in with_traps'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/vendor/deps/cli-kit/lib/cli/kit/executor.rb:51:in `twrap'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/vendor/deps/cli-kit/lib/cli/kit/executor.rb:43:in `with_traps'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/lib/shopify_cli/core/executor.rb:15:in `call'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/lib/shopify_cli/core/entry_point.rb:24:in `block in call'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/lib/shopify_cli/core/monorail.rb:30:in `log'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/lib/shopify_cli/core/entry_point.rb:23:in `call'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/bin/shopify:37:in `block (2 levels) in <top (required)>'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb:75:in `handle_abort'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb:21:in `call'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/bin/shopify:36:in `block in <top (required)>'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/shopify-cli-2.8.0/bin/shopify:47:in `<top (required)>'
from C:/Ruby31-x64/bin/shopify:25:in `load'
from C:/Ruby31-x64/bin/shopify:25:in `<main>'

Can someone help, please?

Replies 4 (4)

Sanjay-Makwana
Shopify Partner
29 0 3

@fyardlest   this is ruby script Error you need to add the code line into the ruby packages. 

SanjayMakwana_0-1642506100740.png

module CLI
  module UI
    module OS
      # Determines which OS is currently running the UI, to make it easier to
      # adapt its behaviour to the features of the OS.
      def self.current
        @current_os ||= case RUBY_PLATFORM
        when /darwin/
          Mac
        when /linux/
          Linux
        when /mingw32/
          Windows
		when /mingw/
          Windows
        else
          raise "Could not determine OS from platform #{RUBY_PLATFORM}"
        end
      end



Add this line of code after the line number 13 

when /mingw/
          Windows



So based on the ruby installation it will take the correct path.

fyardlest
New Member
4 0 0

@Sanjay-Makwana 

Hello and thank you for the answer. Unfortunately, I did that before but still have this login error. You can see a screenshot of this error I attached below.

Sanjay-Makwana
Shopify Partner
29 0 3

@fyardlest  one more change you need to add

SanjayMakwana_0-1643866445195.png




 def os
          return :mac if /darwin/.match(RUBY_PLATFORM)
          return :linux if /linux/.match(RUBY_PLATFORM)
          return :windows if /mingw32/.match(RUBY_PLATFORM)
          return :windows if /mingw/.match(RUBY_PLATFORM)


add this line to 180 line number

 return :windows if /mingw/.match(RUBY_PLATFORM)


this is working for me.
let me know if have any more issue 

Sanjay-Makwana
Shopify Partner
29 0 3

@fyardlest   I can see the shopify cli  this OSversion issued fixed so just removethe current package and install new one that was also working i hope try This one