我的组织有许多用于自动化测试的内部 gem,但生产部署不需要它们。我正在尝试使用 Bundler,因此在我的 Gemfile 中我将这些 gem 包装在:
group :test, :development do
gem 'dashboard_summary'
end
但是,当我运行时:
$ bundle install --without staging development test
我仍然得到
Could not find gem 'dashboard_summary (>= 0) ruby' in the gems available on this machine.
我试图理解为什么当我告诉 Bundler 时,Bundler 没有忽略这个宝石。
这是预期的行为。从the docs http://gembundler.com/v1.3/man/bundle-install.1.html#INSTALLING-GROUPS:
虽然--without
选项将跳过安装指定组中的宝石,它仍然会download这些 gem 并使用它们来解决 Gemfile(5) 中每个 gem 的依赖关系。
虽然是最新的Gemfile.lock
可能表明不需要再次解析依赖项,即使在这种情况下,看起来所有 gem 都已下载。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)