Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
533 views
in Technique[技术] by (71.8m points)

uninstallation - How do I completely uninstall rails, ruby and rubygems?

My system is F'd. How do I completely uninstall rails, ruby and rubygems?

any suggestions on where to go to reinstall from scratch? Best practices? I'd like to get back to 3.0 beta

Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can use gem uninstall to delete all gems as follows:

gem list --no-version | xargs gem uninstall

If you want to keep eg. the gem rake:

gem list --no-version | grep -v "rake" | xargs gem uninstall

To delete only the old versions, you can run gem clean.


Also, it is possible to write all gems in a list:

gem list --no-version > gem_list.txt 

and define these you want to delete:

cat gem_list.txt | xargs gem uninstall 

or install:

cat gem_list.txt | xargs gem install

(eventually you have to put a sudo in front of a gem command. On windows use an unix console enviroment like msysGit)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...