List all gems without version numbers, and easily re-install them
Sometimes when upgrading ruby versions or moving from one dev machine to another I want a list of all my gems that I can then later give to gem install. This sed command strips out the version numbers that usually get appended to gem list
gem list | sed 's/(.*)//'
or
gem list | sed 's/(.*)//' > gemlist.txt
Then, when you want to re-install the gems you can:
cat gemlist.txt | xargs gem install
Written by Ivan Storck
Related protips
3 Responses
you need to close that pipe quote.
gem list | sed 's/(.*)//'
gem list | sed 's/(.*)//' > gemlist.txt
over 1 year ago
·
Thanks @peeyek , it's corrected.
over 1 year ago
·
From https://twitter.com/projct/status/521086515888545793
gem list --no-versions --no-details -l -q >gemlist.txt
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#