ruby-on-rails - 如何告诉 bundler 忽略不存在的 gem ?

标签 ruby-on-rails ruby bundler

我的组织有许多用于自动化测试的内部 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/

相关文章:

ruby - 如何在 Ruby 中绑定(bind)套接字?

ruby - Bundle 安装在 ruby​​ 2.0 升级时损坏

ruby-on-rails - Rubymine 找不到 BUNDLE_PATH 指定的 Gems

ruby-on-rails - 在Rails的文本框中格式化DateTime

Mysql2::错误:无法连接到 '127.0.0.1' 上的 MySQL 服务器 (61)

ruby - EventMachine DeferrableChildProcess 错误处理

ruby - Ruby 中 eval 的替代方法是什么?

ruby-on-rails - Rails - 包括与动态条件的关联

ruby-on-rails - rails : How do I validate model based on parent's attributes?

rubygems - PhusionPassenger::Rack::ApplicationSpawner 中出现异常 LoadError(没有要加载的文件 - bundle 程序)