如何告诉bundler忽略不存在的宝石?

spi*_*epf 6 ruby ruby-on-rails bundler

我的组织有许多内部宝石,用于自动化测试,但不是生产部署所必需的.我正在尝试使用Bundler,因此在我的Gemfile中我将这些宝石包装在:

group :test, :development do
    gem 'dashboard_summary'
end
Run Code Online (Sandbox Code Playgroud)

但是,当我跑:

$ bundle install --without staging development test
Run Code Online (Sandbox Code Playgroud)

我还是得到的

Could not find gem 'dashboard_summary (>= 0) ruby' in the gems available on this machine.
Run Code Online (Sandbox Code Playgroud)

我试图理解为什么Bundler在我告诉它时不会忽视那个宝石.

mat*_*att 5

这是预期的行为。从文档

尽管该--without选项将跳过在指定组中安装 gems,但仍将下载这些gems并使用它们来解析Gemfile(5)中每个gem的依赖关系。

尽管最新消息Gemfile.lock可能表明不需要再次解决依赖关系,但即使在这种情况下,看起来所有的gem也都已下载。