You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a Rails app, find the directory where gems are being installed. In mine, it is there: /bundle/ruby/2.7.0/gems
List the gems and make note of specific gem of you r choosing, I'll work with addressfinder
Run bundle info your_gem_name, you should get something like that:
Delete/remove the gem from the gem directory
Run bundle info your_gem_name again, you will see no difference to the screenshot above
Now list all the gems again, you will see that the gem you moved is not there anymore but bundle info still tells you that the path to the gem is unchanged.
If you try to run your app (assuming it is using the gem) it will be broken
If you try to run bundle install nothing will happen, bundler seems to think that the gem is installed, even though it isn't there anymore.
To return to a working state of your app, run bundle install --force
Expected behaviour
Once the gem has been deleted from the gems directory, bundle info gem_name should return "The gem #{gem_name} has been deleted. It was installed at: #{path}"
bundle install should check whether all gems exist locally and if not, trigger a reinstall
Additional notes:
This behaviour can be reproduced in a skeleton app with a single folder with two files: Gemfile and Gemfile.lock and a single gem
Discussed in #4949
Unexpected behaviour to reproduce:
/bundle/ruby/2.7.0/gems
addressfinder
bundle info your_gem_name
, you should get something like that:bundle info your_gem_name
again, you will see no difference to the screenshot abovebundle info
still tells you that the path to the gem is unchanged.bundle install
nothing will happen, bundler seems to think that the gem is installed, even though it isn't there anymore.bundle install --force
Expected behaviour
bundle info gem_name
should return"The gem #{gem_name} has been deleted. It was installed at: #{path}"
bundle install
should check whether all gems exist locally and if not, trigger a reinstallAdditional notes:
Gemfile
andGemfile.lock
and a single gemCheers 🙏
The text was updated successfully, but these errors were encountered: