You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

运行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.md

Please 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

解决步骤

  1. 配置主题目录的Gemfile
    进入你的Shopify主题根目录,创建或编辑Gemfile,添加代码:

    gem 'wdm', '>= 0.1.0' if Gem.win_platform?
    
  2. 安装依赖
    在主题目录下运行:

    bundle install
    

    让Bundler处理依赖加载逻辑,确保wdm被正确识别。

  3. 重启开发服务
    关闭当前的CLI进程,重新执行:

    shopify theme dev
    
  4. 验证gem安装状态
    运行以下命令确认wdm已安装:

    gem list wdm
    

    如果无结果,尝试用用户权限安装:

    gem install wdm --user-install
    
  5. 更新Shopify CLI
    旧版本可能存在Windows兼容问题,更新到最新版:

    npm install -g @shopify/cli
    

内容的提问来源于stack exchange,提问作者Tor

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.12 14:30:51