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

Gemfile.lock含middleman-cli,但bundle install未安装该依赖致报错

Solution: Use bundle exec to Access Your Bundled Gems

The problem here boils down to how Bundler isolates gem environments when you use the --path flag. When you run bundle install --no-cache --path ./vendor/bundle, all required gems (including middleman-cli) get installed into the local ./vendor/bundle directory—not your system-wide or user-specific gem repository. That’s why commands like ruby -S gem list --local don’t show any middleman-related gems: they’re looking in the wrong place!

Bundler creates a self-contained gem environment for your project, so to use any of those gems, you need to run commands through Bundler itself with the bundle exec prefix. Here’s how to fix this:

  1. Run widdershins via Bundler
    Instead of calling widdershins directly, use this command to ensure it uses your project’s isolated gem set:

    bundle exec widdershins [path-to-your-openapi-spec] [output-file]
    

    This will let widdershins access the middleman-cli gem installed in ./vendor/bundle.

  2. Verify installed gems correctly
    To see all gems Bundler installed for your project (including middleman), run:

    bundle exec gem list --local
    

    Unlike your previous commands, this will show you the full list of gems in your project’s isolated environment.

  3. Update your Jenkinsfile
    Make sure any subsequent commands that rely on the project’s gems are also prefixed with bundle exec. For example, if you’re building the Slate docs later, your command should look like:

    sh 'bundle exec middleman build'
    

The core takeaway: when you use --path with bundle install, you’re opting into an isolated gem environment—so all tooling that depends on those gems must be run through bundle exec to access them.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.29 06:47:49