我是否必须手动卸载所有依赖的 gem? [英] Do I have to manually uninstall all dependent gems?

查看:18
本文介绍了我是否必须手动卸载所有依赖的 gem?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用命令 gem uninstall dm-core 卸载 datamapper.

I tried to uninstall datamapper using the command gem uninstall dm-core.

但是好像还需要卸载一大堆依赖的gem.

But it seems that a whole bunch of dependent gems also need to be uninstalled.

C:>gem uninstall dm-core

You have requested to uninstall the gem:
        dm-core-0.9.11
dm-migrations-0.9.11 depends on [dm-core (= 0.9.11)]
dm-cli-0.9.11 depends on [dm-core (= 0.9.11)]
dm-serializer-0.9.11 depends on [dm-core (= 0.9.11)]
dm-timestamps-0.9.11 depends on [dm-core (= 0.9.11)]
dm-aggregates-0.9.11 depends on [dm-core (= 0.9.11)]
dm-types-0.9.11 depends on [dm-core (= 0.9.11)]
dm-is-tree-0.9.11 depends on [dm-core (= 0.9.11)]
dm-observer-0.9.11 depends on [dm-core (= 0.9.11)]
dm-validations-0.9.11 depends on [dm-core (= 0.9.11)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn]  n
ERROR:  While executing gem ... (Gem::DependencyRemovalException)
    Uninstallation aborted due to dependent gem(s)

我尝试查找有关gem 卸载"的文档,但似乎没有办法自动卸载依赖项:

I tried finding documentation on "gem uninstall" but there doesn't seem to be a way to uninstall the dependencies automatically:

C:>gem help uninstall
Usage: gem uninstall GEMNAME [GEMNAME ...] [options]

  Options:
    -a, --[no-]all                   Uninstall all matching versions
    -I, --[no-]ignore-dependencies   Ignore dependency requirements while
                                     uninstalling
    -x, --[no-]executables           Uninstall applicable executables with
out
                                     confirmation
    -i, --install-dir DIR            Directory to uninstall gem from
    -n, --bindir DIR                 Directory to remove binaries from
        --[no-]user-install          Uninstall from user's home directory
                                     in addition to GEM_HOME.
    -v, --version VERSION            Specify version of gem to uninstall
        --platform PLATFORM          Specify the platform of gem to uninst
all

  Common Options:
    -h, --help                       Get help on this command
    -V, --[no-]verbose               Set the verbose level of output
    -q, --quiet                      Silence commands
        --config-file FILE           Use this config file instead of defau
lt
        --backtrace                  Show stack backtrace on errors
        --debug                      Turn on Ruby debugging


  Arguments:
    GEMNAME       name of gem to uninstall

  Summary:
    Uninstall gems from the local repository

  Defaults:
    --version '>= 0' --no-force --install-dir C:/Ruby18/lib/ruby/gems/1.8
    --user-install

C:>

我错过了什么吗?

推荐答案

据我所知,你是对的,gem 命令没有内置的简单方法可以做到这一点.

As far as I know you're correct, there is not an easy way built-in to the gem command to do this.

但是,您可以查看 gem-prune,它可以帮助您在删除 dm-core 后清理您的 gem 存储库.

However, you can check out gem-prune which can help clean up your gem repository after you've removed dm-core.

http://github.com/ddollar/gem-prune/tree/master

这篇关于我是否必须手动卸载所有依赖的 gem?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆