我的组织有许多用于自动化测试的内部 gem,但生产部署不需要这些 gem。我正在尝试使用 Bundler,因此在我的 Gemfile 中我将这些 gems 包装在:
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 在我告诉它时没有忽略该 gem。
最佳答案
这是预期的行为。来自 the docs :
While the
--without
option will skip installing the gems in the specified groups, it will still download those gems and use them to resolve the dependencies of every gem in your Gemfile(5).
虽然最新的 Gemfile.lock
可能表明不需要再次解析依赖项,但即使在这种情况下,看起来所有的 gem 都已下载。
关于ruby-on-rails - 如何告诉 bundler 忽略不存在的 gem ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16741935/