Bundler 不会忽略我将 --without 选项传递给的组中的宝石

Bundler not ignoring the gems in the group I pass the --without option to

我正在尝试捆绑安装而不 rubygem 引入 nokogumbo 并在安装中 运行 安装它。

在我的gem文件中,我有

...
group :nonbundled do
  gem 'nokogumbo', '1.4.13'
end
...

运行 bundle install --without nonbundled 仍在搜索 gem

...    
Using jquery-ui-rails 6.0.1
Using jwt 1.5.6
Using koala 3.0.0
Using mini_magick 4.5.1
Using ruby-progressbar 1.8.1
Using minitest-reporters 1.1.9
Using multi_xml 0.6.0
Fetching nokogumbo 1.4.13
Installing nokogumbo 1.4.13 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
...

这是怎么回事?

谢谢。

您在评论中提到 nokogumbo 是另一个 gem 的依赖项。因此,它正在安装。

如果您在执行捆绑安装时使用 --without 参数,并且如果本应跳过的 gem 作为依赖项存在于另一个 Gem 中,它将被安装。

reference for above