A few recommendations before getting to the crux of the content:
- Opt for incremental updates over bulk changes. This approach reduces the surface area for things to go wrong
- Use bundler to manage your project’s dependencies
Updating patch versions
bundle update --patch <name of gem>
To prevent updating indirect dependencies restrict the updates, add the --conservative
flag.
Updating minor versions
bundle update --minor <name of gem>
Updating major versions
You guessed it -
bundle update --major <name of gem>
Update groups of gems
Sometimes, you may want to update specific groups of gems, such as your development or testing gems.
bundle update --group development
See which gems are out of date
bundle outdated --groups