如何告诉捆绑器忽略不存在的宝石? [英] How to tell bundler to ignore gems that don't exist?

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

问题描述

我的组织中有许多内部宝石,这些宝石可用于自动化测试,但生产部署不需要这些宝石。我正在尝试使用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:


虽然 --without 选项将跳过安装指定的组,它仍然会下载这些gem,并使用它们来解析您Gemfile(5)中每个gem的依赖性。

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都已下载,即使这种情况。

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.

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆