如何卸载所有使用`bundle install`安装的gems [英] How to uninstall all gems installed using `bundle install`
本文介绍了如何卸载所有使用`bundle install`安装的gems的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在特定RoR项目中删除使用捆绑安装
安装的所有gem。我不想卸载其他项目使用的gem。
How can I remove all the gems installed using bundle install
in a particular RoR project. I don't want to uninstall gems that are used by other projects.
推荐答案
由于我们使用的是ruby,因此您可以做一些事情我猜是这样的:
Since we're using ruby you could do something like this I guess:
bundle list | ruby -e 'ARGF.readlines[1..-1].each {|l| g = l.split(" "); puts "Removing #{g[1]}"; `gem uninstall --force #{g[1]} -v #{g[2].gsub(/\(|\)/, "")}`; }'
注意:仅经过轻微测试。
NOTE: Only lightly tested.
这篇关于如何卸载所有使用`bundle install`安装的gems的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文