robzolkos
robzolkos

Reputation: 2286

Bundler - updating gems in a particular group

In my gemfile I have gems that are only installed in test or development group.

eg

group :test do
  gem "rspec-rails"
end

group :development do
  gem "dev_gem"
end

Is there a way I can bundle update only the gems in these two groups?

I don't want to update ALL the gems in the Gemfile. Just the ones in test and development.

Upvotes: 14

Views: 1826

Answers (2)

grzuy
grzuy

Reputation: 5041

Yes, with

$ bundle update --conservative --group test development

Bundler’s --conservative option is key, because it prevents updates in any "Production" gem that is also a dependency of a "Test" or "Development" gem.

Upvotes: 23

robzolkos
robzolkos

Reputation: 2286

Bundler now has this option

bundle update <*gems> [--group=NAME] [--source=NAME] [--local]

Upvotes: 0

Related Questions