Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails bundler: how to undo bundle package?

How do I undo bundle package?

I deleted everything in vendor/cache but it is reinstalled there when I run bundle install.

like image 232
HappyDeveloper Avatar asked Feb 26 '12 11:02

HappyDeveloper


People also ask

How do I delete bundles in rails?

That way when you want to perform a full cleanup you can simply remove the gemset, which in turn removes all the gems installed in it. Your other option is to simply uninstall your unused gems and re-run your bundle install command.

What does bundle clean do?

Description. This command will remove all unused gems in your bundler directory. This is useful when you have made many changes to your gem dependencies.

How do I remove gem from Gemfile lock?

You can run just bundle or bundle install to install gems based on your Gemfile. That will remove the instance of mygem from your Gemfile. lock file.


2 Answers

As per this answer: https://stackoverflow.com/a/9471980/219883

You must delete the hidden .bundle directory, then re-run bundle install - otherwise it will continue to add the vendor/cache directory back every time.

like image 191
Taryn East Avatar answered Oct 09 '22 07:10

Taryn East


But if you just to remove a particular gem, then remove/comment the name of the gem from your project/Gemfile and then run bundle.

To prevent gem files from being added to the vendor/cache directory delete the vendor/cache directory from your project root.

The next time you will run bundle install gems won't create a vendor/cache folder.

Later on in your project if you need the vendor/cache folder all you'll have to do is to create the folder vendor/cache again.

like image 8
nightf0x Avatar answered Oct 09 '22 09:10

nightf0x