Last active
December 24, 2015 09:18
-
-
Save ewalk153/6775899 to your computer and use it in GitHub Desktop.
Remove all gems matching a certain version number with a shell script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # simple bash script that unstalls a version of rails (this could break if you have other gems matching the exact version name) | |
| # here we remove rails 4.0.0.rc1 | |
| # v1, simple | |
| #gem list | grep 4.0.0.rc1 | awk -F= 'BEGIN {FS = " "} ; {print $1}' | while read x ; do gem uninstall $x -v 4.0.0.rc1 ; done | |
| # v2, even shorter, no need for awk | |
| gem list | grep 4.0.0.rc1 | while read name _; do gem uninstall $name -v 4.0.0.rc1 ; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment