【问题标题】:Why won't this gem be uninstalled为什么这个 gem 不会被卸载
【发布时间】:2014-01-02 15:26:58
【问题描述】:

我在我的 Gemfile 中使用这个 repository 安装了一个 gem:

gem 'copy_carrierwave_file', github: 'equivalent/copy_carrierwave_file'

当我尝试使用以下方式卸载它时:

gem uninstall copy_carrierwave_file

没有显示像copy_carrierwave is uninstalled successfuly from....

然后如果我输入:

bundle show copy_carrierwave_file

它仍然显示这颗宝石的位置

如何卸载?

【问题讨论】:

  • git,或路径定位,或开发 gem 由 bunlder 控制。只需将其从 Gemfile 中删除
  • 你是什么意思他们被捆绑器控制?
  • 我的意思是这样的 gem 会被 bundler 破解出来,然后从代码中创建一个 gem。

标签: ruby rubygems bundler gemfile


【解决方案1】:

由于 git、github 和 path 被定位,或者开发 gem 是由 bunlder 控制的,你只需从 Gemfile 中删除 put 即可删除 gem。你甚至不需要再次运行bundle install

$ bundle show session

Could not find gem 'session'.

【讨论】:

    【解决方案2】:

    捆绑清洁。由于 gem 是使用 bundler 安装的,因此也必须使用 bundler 卸载它们!

    首先,从您的Gemfile 中删除gem 'copy_carrierwave_file', github: 'equivalent/copy_carrierwave_file'

    然后,将清洁与空运行捆绑在一起(以防万一您看到不想移除的宝石):

    bundle clean --force --dry-run
    

    如果您想移除这些宝石,请将其清理干净:

    bundle clean --force
    

    【讨论】:

      猜你喜欢
      • 2011-09-06
      • 2019-09-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多