在 Windows 10 专业版中安装 Shopify CLI(基于 RubyInstaller for Windows 安装 Ruby)
1、要安装和运行 Shopify CLI,您需要在计算机上安装以下软件:Ruby 或 Ruby+Devkit using RubyInstaller for Windows 2.7+ 版本、Git。参考:https://shopify.dev/themes/getting-started/create#step-1-install-shopify-cli 。如图1
2、现在计算机上已经安装了 Git,还未安装 Ruby,最终决定安装 Ruby+Devkit 3.1.X (x64),下载安装 rubyinstaller-devkit-3.1.1-1-x64.exe。如图2
3、安装 Shopify CLI,执行命令:gem install shopify-cli。如图3
PS C:\Windows\system32> gem install shopify-cli Fetching ast-2.4.2.gem Fetching parser-3.1.2.0.gem Fetching nokogiri-1.13.4-x64-mingw-ucrt.gem Fetching liquid-5.3.0.gem Fetching theme-check-1.10.2.gem Fetching ffi-1.15.5-x64-mingw-ucrt.gem Fetching rb-inotify-0.10.1.gem Fetching rb-fsevent-0.11.1.gem Fetching shopify-cli-2.15.6.gem Fetching listen-3.7.1.gem Fetching concurrent-ruby-1.1.10.gem Fetching bugsnag-6.24.2.gem Successfully installed ast-2.4.2 Successfully installed parser-3.1.2.0 Successfully installed nokogiri-1.13.4-x64-mingw-ucrt Successfully installed liquid-5.3.0 Successfully installed theme-check-1.10.2 Successfully installed ffi-1.15.5-x64-mingw-ucrt Successfully installed rb-inotify-0.10.1 Successfully installed rb-fsevent-0.11.1 Successfully installed listen-3.7.1 Successfully installed concurrent-ruby-1.1.10 Successfully installed bugsnag-6.24.2 Temporarily enhancing PATH for MSYS/MINGW... Building native extensions. This could take a while... Successfully installed shopify-cli-2.15.6 Parsing documentation for ast-2.4.2 Installing ri documentation for ast-2.4.2 Parsing documentation for parser-3.1.2.0 Installing ri documentation for parser-3.1.2.0 Parsing documentation for nokogiri-1.13.4-x64-mingw-ucrt Installing ri documentation for nokogiri-1.13.4-x64-mingw-ucrt Parsing documentation for liquid-5.3.0 Installing ri documentation for liquid-5.3.0 Parsing documentation for theme-check-1.10.2 Installing ri documentation for theme-check-1.10.2 Parsing documentation for ffi-1.15.5-x64-mingw-ucrt Installing ri documentation for ffi-1.15.5-x64-mingw-ucrt Parsing documentation for rb-inotify-0.10.1 Installing ri documentation for rb-inotify-0.10.1 Parsing documentation for rb-fsevent-0.11.1 Installing ri documentation for rb-fsevent-0.11.1 Parsing documentation for listen-3.7.1 Installing ri documentation for listen-3.7.1 Parsing documentation for concurrent-ruby-1.1.10 Installing ri documentation for concurrent-ruby-1.1.10 Parsing documentation for bugsnag-6.24.2 Installing ri documentation for bugsnag-6.24.2 Parsing documentation for shopify-cli-2.15.6 Installing ri documentation for shopify-cli-2.15.6 Done installing documentation for ast, parser, nokogiri, liquid, theme-check, ffi, rb-inotify, rb-fsevent, listen, concurrent-ruby, bugsnag, shopify-cli after 61 seconds 12 gems installed
4、在终端中,导航到要克隆 Dawn 的工作目录。输入以下命令。确认 Shopify CLI 已经安装无误。如图4
PS E:\wwwroot> ┏━━ Cloning https://github.com/Shopify/dawn.git into dawn-20220420-1… ━━━━━━━━━ ┃ 100% ┗━━ √ Cloned into dawn-20220420-1 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ (17.06s) ━━━ PS E:\wwwroot> PS E:\wwwroot> PS E:\wwwroot> shopify theme init ? Theme name > dawn-20220420-1
5、进入目录:dawn-20220420-1,查看文件列表。如图5
PS E:\wwwroot> cd .\dawn-20220420-1\ PS E:\wwwroot\dawn-20220420-1> ls 目录: E:\wwwroot\dawn-20220420-1 Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 2022/4/20 9:34 .vscode d----- 2022/4/20 9:34 assets d----- 2022/4/20 9:34 config d----- 2022/4/20 9:34 layout d----- 2022/4/20 9:34 locales d----- 2022/4/20 9:34 sections d----- 2022/4/20 9:34 snippets d----- 2022/4/20 9:34 templates -a---- 2022/4/20 9:34 127 .gitignore -a---- 2022/4/20 9:34 76 .theme-check.yml -a---- 2022/4/20 9:34 1423 LICENSE.md -a---- 2022/4/20 9:34 7187 README.md -a---- 2022/4/20 9:34 3521 release-notes.md -a---- 2022/4/20 9:34 691 translation.yml PS E:\wwwroot\dawn-20220420-1>
近期评论