Bundler is launched from your app's root directory so it makes sure all needed gems are present to get your app working.If for some reason you no longer need a gem you'll have to run the

    gem uninstall gem_name 

as you stated above.So every time you run bundler it'll recheck dependencies

EDIT - 24.12.2014

I see that people keep coming to this question I decided to add a little something. The answer I gave was for the case when you maintain your gems global. Consider using a gem manager such as rbenv or rvm to keep sets of gems scoped to specific projects.

This means that no gems will be installed at a global level and therefore when you remove one from your project's Gemfile and rerun bundle then it, obviously, won't be loaded in your project. Then, you can run bundle clean (with the project dir) and it will remove from the system all those gems that were once installed from your Gemfile (in the same dir) but at this given time are no longer listed there.... long story short - it removes unused gems.

Answer from Daniel on Stack Overflow
🌐
Bundler
bundler.io › man › bundle-remove.1.html
Bundler: bundle remove
If a gem cannot be removed, a warning is printed. If a gem is already absent from the Gemfile, and error is raised. ... Runs bundle install after the given gems have been removed from the Gemfile, which ensures that both the lockfile and the installed gems on disk are also updated to remove ...
Discussions

After bundle update, how do you guys delete old version gems?
It doesn’t really matter unless you’ve got storage issues. But you shouldn’t be using sudo for anything. More on reddit.com
🌐 r/rails
17
3
September 13, 2024
bundle clean --force removes gems bundled with Ruby
If I run bundle clean --force (in an effort to remove old gem version when the bundle needs to be updated), bundler will removed "bundled gems" - gems that are packaged with ruby. (see ht... More on github.com
🌐 github.com
9
August 3, 2018
ruby on rails - How to uninstall all gems installed using `bundle install` - Stack Overflow
How can I remove all the gems installed using bundle install in a particular RoR project. I don't want to uninstall gems that are used by other projects. More on stackoverflow.com
🌐 stackoverflow.com
ruby on rails - What to do after removing a gem from the Gemfile? - Stack Overflow
I removed a gem 'mygem' from the Gemfile, but just now I realized it's still installed. So how do I tell bundler to rescan the Gemfile and update Gemfile.lock, without updating every gem? More on stackoverflow.com
🌐 stackoverflow.com
April 12, 2017
🌐
Ubuntu Manpages
manpages.ubuntu.com › focal › man(1)
Ubuntu Manpage: bundle-remove - Removes gems from the Gemfile
If a gem cannot be removed, a warning is printed. If a gem is already absent from the Gemfile, and error is raised. ... Runs bundle install after the given gems have been removed from the Gemfile, which ensures that both the lockfile and the installed gems on disk are also updated to remove the given gem(s).
🌐
GitHub
github.com › rubygems › bundler › issues › 6648
bundle clean --force removes gems bundled with Ruby · Issue #6648 · rubygems/bundler
August 3, 2018 - If I run bundle clean --force (in an effort to remove old gem version when the bundle needs to be updated), bundler will removed "bundled gems" - gems that are packaged with ruby. (see ht...
Author   jessebs
🌐
Medium
channaly.medium.com › rails-tips-and-trick-1cb270fb0ab5
How to remove a default bundler gem | by Ly Channa | Medium
September 16, 2020 - The code returns the directory where default gems reside. You can find the gemspec file and delete it manually. I found that after deleting the bundler-2.1.2.gemspec from the directory, bundle command still complaint with the warning above then I try this
🌐
eMaxime Blog
emaxime.com › 2018 › how-to-uninstall-all-ruby-gems
How to uninstall all Ruby gems - eMaxime
October 21, 2018 - Sometimes you want to remove all installed gems from your computer. This was the case for me when I upgraded my projects from Ruby 2.5.1 to 2.5.3 in order to clean things up in 2.5.1 and regain disk space. Lots of Google entries for such a search point to: ... ERROR: While executing gem ... (Gem::InstallError) gem "bigdecimal" cannot be uninstalled because it is a default gem ... gem list --no-version | grep -vE "^(bigdecimal|bundler|cmath|csv|date|dbm|etc|fcntl|fiddle|fileutils|gdbm|io-console|ipaddr|openssl|psych|rdoc|scanf|sdbm|stringio|strscan|webrick|zlib)$" | xargs gem uninstall -aIx
Find elsewhere
🌐
DEV Community
dev.to › st0012 › completely-remove-the-default-bundler-from-ci-environment-j0c
Completely Remove Ruby 2.7's Default Bundler - DEV Community
August 9, 2020 - Now if I create a new Gemfile and run bundle install, it'll still use 2.1.4 instead of 1.17.3. $ echo "source 'https://rubygems.org'" >> Gemfile $ bundle The Gemfile specifies no dependencies Resolving dependencies... Bundle complete! 0 Gemfile dependencies, 1 gem now installed.
🌐
Steam Community
steamcommunity.com › app › 570 › discussions › 0 › 1635237606651791777
removing gems from a bundle :: Dota 2 General Discussions
You have to unbundle the set to remove the gems. ... Originally posted by Sensei Swagger:oh u want to sell it in the market? the only way to remove a gem is opening the pack.
🌐
GitHub
github.com › rubygems › bundler › issues › 2146
Removing gem from Gemfile do not remove the gem from the Gemfile.lock file · Issue #2146 · rubygems/bundler
November 5, 2012 - It seems that removing a gem from the Gemfile don't update the Gemfile.lock. For example, I had a gem in my Gemfile. I removed it and then executed bundle. I removed it with gem uninstall gem_n...
Author   zedtux
🌐
CircleCI
discuss.circleci.com › build environment › programming languages
Remove cached ruby gems in vendor/bundle path - Programming Languages - CircleCI Discuss
November 12, 2015 - In our RoR project I need to update the version for capybara-webkit gem that we're using on our builds. I found that CI automatically caches the gems between builds. How can I remove/override the vendor/bundle path in or…
🌐
GitHub
github.com › ruby › rubygems › issues › 5436
`bundle remove` does not run install, with or without deprecated flag · Issue #5436 · ruby/rubygems
March 29, 2022 - Describe the problem as clearly as you can During my testing I have found that bundle remove does not change lockfiles. Not sure if it worked for a while or not, but I did find the merged PR and closed issue where the --install flag was ...
Author   joe-sharp
🌐
SitePoint
sitepoint.com › blog › gems › unbundling bundler: a thorough look at bundler’s utilities
Unbundling Bundler: A Thorough Look at Bundler's Utilities — SitePoint
November 13, 2024 - This message is a warning from Bundler to prevent accidental deletion of important gems. If you’re sure you want to remove all gems, you can use the command bundle clean --force.
🌐
Jekyll Talk
talk.jekyllrb.com › help
Uninstall / Fix Jekyll Bundler - Help - Jekyll Talk
June 2, 2020 - How can I uninstall/undo everything initiated by gem install jekyll bundler? Running gem uninstall jekyll removes the gem, but still leaves a bunch of orphaned directories in the wrong user account… Sorry if this ...
🌐
Steam Community
steamcommunity.com › app › 570 › discussions › 0 › 617329920709766433
How to remove gem from bundle? :: Dota 2 General Discussions
March 10, 2015 - Originally posted by MXTheChuck:you cant remove gems from bundles, otherwise you could just sell the uninscribed bundles for way more dosh. ya I think so. I hope valve will do anything about this. I'm wandering....