使用依赖关系卸载Rails

使用依赖关系卸载Rails

本文介绍了使用依赖关系卸载Rails 3?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢Rails 3的安装非常简单: gem install rails --pre ,并且所有依赖项都会自动为您安装。但是,卸载它呢?如果我只是做 gem uninstall rails ,我仍然有

I like that Rails 3 is so easy to install: gem install rails --pre, and all of the dependencies are automatically installed for you. But, what about uninstalling it? If I just do gem uninstall rails, I still have

actionmailer (3.0.0.beta3)
actionpack (3.0.0.beta3)
activemodel (3.0.0.beta3)
activerecord (3.0.0.beta3)
activeresource (3.0.0.beta3)
activesupport (3.0.0.beta3)

我想要的摆脱。最简单的方法是什么?

which I want to get rid of. What's the easiest way to do so?

推荐答案

如果您打算升级到较新版本的rails,您可以:

if you're planning to upgrade to a newer version of rails, you can do:

sudo gem clean

或更新版本

sudo gem cleanup

新版本安装后,此卸载所有旧版所有您的系统中的最新版本。

after the newer version has been installed, this uninstall All older versions of All your gems leaving only the latest version in your system.

注意:这些天我使用RVM gemset和/或bundler来管理我的宝石,如果您使用RVM,我发现它很多这种方式更简单。例如,您可以为每个项目创建一个新的gemset:

Note: these days I use RVM gemset and/or bundler to manage my gems, if you're using RVM I find it's a lot simpler this way. For example you can create a new gemset for each project:

rvm gemset create project_name
rvm gemset use project_name
bundle install

出现任何问题,您可以删除gemset并重新启动$ / $>

anything goes wrong you can just delete the gemset and start again

rvm gemset delete project_name

这篇关于使用依赖关系卸载Rails 3?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 17:16