本文介绍了如何告诉捆绑器忽略不存在的宝石?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

My organization has a number of in-house gems that are used in automated testing, but are not required for a production deployment. I am trying to use Bundler and so in my Gemfile I've wrapped those gems in:

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.

我想了解为什么当我告诉邦德勒时,他并没有忽略那个宝石。

I'm trying to understand why Bundler isn't ignoring that gem when I've told it to.

推荐答案

这是预期的行为。来自:

This is expected behaviour. From the docs:

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

Whilst an up to date Gemfile.lock might suggest that the dependencies don’t need to be resolved again, it looks like all gems are downloaded even in this case.

这篇关于如何告诉捆绑器忽略不存在的宝石?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-24 22:40