Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I delete gems for old ruby versions installed by bundler?

I want to free up disk space in my production environment taken up by gems installed for old ruby versions. I don't believe bundle clean will work in this instance, because I don't think it cleans out the old gems for other rubies.

These gems are installed via capistrano and are installed in a custom location, rather than system wide. In my /path/to/my-project/shared/bundle/ruby dir, I see 2 subdirs - 2.2.0 & 2.3.0. Since I am now using ruby 2.3, is it safe just to delete the 2.2.0 directory? Is there anything else I need to do?

like image 999
robd Avatar asked Jan 10 '17 17:01

robd


Video Answer


1 Answers

Use "sudo gem cleanup" to remove all previously installed gems which respecting all the dependencies be it on old version of ruby. You can see all the gems that ll be removed with command "sudo gem cleanup -d"

like image 187
Shikhar Mann Avatar answered Oct 16 '22 05:10

Shikhar Mann