Somehow i cannot use bundle install --without ... as explained in Bundler's documentation. Here is how i can reproduce this: create a new directory with just a Gemfile:

# Gemfile
source 'https://rubygems.org'
ruby '2.1.1'
gem 'not-a-gem', :group => :test

and run

bundle install --without test

I get the error

Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Could not find gem 'not-a-gem (>= 0) ruby' in the gems available on this
machine.

What am i missing?

有帮助吗?

解决方案

Bundler always resolves the dependencies for all your gems, even if you're excluding a group. Otherwise, it might overlook a conflict that will arise later when you don't exclude that group.

If all the gems and versions are valid and the dependencies are resolved properly, then Bundler will respect your wishes and not install gems in the group.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top