HiveBrain v1.2.0
Get Started
← Back to all entries
patternrubyCritical

Uninstall old versions of Ruby gems

Submitted by: @import:stackoverflow-api··
0
Viewed 0 times
uninstallversionsoldrubygems

Problem

I have several versions of a Ruby gem:

$ gem list
rjb (1.3.4, 1.3.3, 1.1.9)


How can I remove old versions but keep the most recent?

Solution

# remove all old versions of the gem
gem cleanup rjb

# choose which ones you want to remove
gem uninstall rjb

# remove version 1.1.9 only
gem uninstall rjb --version 1.1.9

# remove all versions less than 1.3.4
gem uninstall rjb --version '<1.3.4'

Code Snippets

# remove all old versions of the gem
gem cleanup rjb

# choose which ones you want to remove
gem uninstall rjb

# remove version 1.1.9 only
gem uninstall rjb --version 1.1.9

# remove all versions less than 1.3.4
gem uninstall rjb --version '<1.3.4'

Context

Stack Overflow Q#5902488, score: 751

Revisions (0)

No revisions yet.