本文是小编为大家收集整理的关于移除所有已安装的宝石并重新开始的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。
问题描述
我最近开始在铁轨上学习Ruby和Ruby,并观看了大量入门材料.我最近发现我一直在遇到宝石无法安装的错误或将安装它们,但由于某种原因无法使用它们,我决定要再次将所有内容删除,以再次安装Ruby然后重新开始安装.一个培训视频让我使用RVM安装了我的大部分宝石,所以我不知道是否会改变任何东西.
简而言之,我的问题是"如何摆脱RVM,RubyGems和所有已安装的宝石,以便我可以从Ruby开始?"
编辑:我在Mac OS 10.6
推荐答案
来自 rvm 支持网站:
rvm将所有内容安装到〜/.rvm中. 从系统运行'rm中删除RVM -rf〜/.rvm'.您可以在〜/.rvmrc中有一个附加的配置文件,并且 当然,您的RVM挂钩 bash/zsh启动文件.
所以,只需转到命令行,然后键入rm -rf ~/.rvm
所有已安装的宝石都在〜/.rvm文件夹中,因此以上操作将删除宝石和一口气安装的红宝石.
gems您添加了使用默认红宝石安装的pre-rvm,可以通过在命令提示符下键入此键:
:for x in `gem list --no-versions`; do gem uninstall $x -a -x -I; done
其他推荐答案
gem uninstall -aIx
无需提示即可卸载所有宝石.
选项
-a, --[no-]all Uninstall all matching versions
-I, --[no-]ignore-dependencies Ignore dependency requirements while
uninstalling
-x, --[no-]executables Uninstall applicable executables without
confirmation
其他推荐答案
对于 Windows 和 unix 复制/粘贴在命令提示中( ruby 1.9.x ).
ruby -e "`gem list`.split(/$/).each { |line| puts `gem uninstall -Iax #{line.split(' ')[0]}` unless line.strip.empty? }"
问题描述
I recently started learning Ruby and Ruby on Rails, and have watched a plethora of getting started materials. I have been finding lately that I keep getting errors where gems won't install or they will be installed but they can't be used for some reason, and I have decided that I want to remove everything down to once again just having Ruby installed and start over with the installation. One training video had me install most of my gems with RVM, so I don't know if that changes anything.
So in short my question is "How to I get rid of RVM, Rubygems, and all installed Gems so that I can start over with just Ruby?"
Edit: I am on Mac OS 10.6
推荐答案
From the RVM support site:
RVM installs everything into ~/.rvm. To remove RVM from your system run 'rm -rf ~/.rvm'. You may have one additional config file in ~/.rvmrc and of course the RVM hook in your bash/zsh startup files.
So, just go to the command line and type rm -rf ~/.rvm
All the installed gems are in the ~/.rvm folders, so doing the above will remove the gems and installed rubies in one go.
Gems you added pre-RVM with the default ruby install can be removed by typing this at the command prompt:
for x in `gem list --no-versions`; do gem uninstall $x -a -x -I; done
其他推荐答案
gem uninstall -aIx
Uninstalls all gems without prompt.
Options
-a, --[no-]all Uninstall all matching versions -I, --[no-]ignore-dependencies Ignore dependency requirements while uninstalling -x, --[no-]executables Uninstall applicable executables without confirmation
其他推荐答案
For Windows and Unix copy/paste in command prompt (Ruby 1.9.x).
ruby -e "`gem list`.split(/$/).each { |line| puts `gem uninstall -Iax #{line.split(' ')[0]}` unless line.strip.empty? }"