运行shopify theme dev时遇LoadError:无法加载wdm文件求助
Shopify CLI
shopify theme dev 加载wdm失败的解决方法 问题详情
执行shopify theme dev命令时触发以下错误:
[Note] You cannot use gems with Shopify CLI.
[LoadError] cannot load such file -- wdm
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.mdPlease add the following to your Gemfile to avoid polling for changes:
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
已尝试执行gem install wdm,但问题仍未解决。
环境信息
- 操作系统:Windows 11
- Shopify-CLI:3.23.0
- Ruby:ruby 3.0.4p208(2022-04-12 revision 3fa771dded) [x64-mingw32]
- Node.js:v18.12.1
- Bundler版本:2.3.25 (2022-11-02 commit 6b0b87b1ed)
- git版本:2.38.1.windows.1
解决步骤
配置主题目录的Gemfile
进入你的Shopify主题根目录,创建或编辑Gemfile,添加代码:gem 'wdm', '>= 0.1.0' if Gem.win_platform?安装依赖
在主题目录下运行:bundle install让Bundler处理依赖加载逻辑,确保wdm被正确识别。
重启开发服务
关闭当前的CLI进程,重新执行:shopify theme dev验证gem安装状态
运行以下命令确认wdm已安装:gem list wdm如果无结果,尝试用用户权限安装:
gem install wdm --user-install更新Shopify CLI
旧版本可能存在Windows兼容问题,更新到最新版:npm install -g @shopify/cli
内容的提问来源于stack exchange,提问作者Tor
相关产品推荐
相关产品推荐

