如何从Rails项目中删除宝石? [英] How to remove gems from Rails project?

查看:68
本文介绍了如何从Rails项目中删除宝石?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从项目中删除一个gem,所以我进入了gem文件并对其进行了注释。

I'm trying to remove a gem from my project so I went into the gem file and commented it out.

...
gem some_gem
# gem 'gem_I_dont_want'
gem another_gem
....

然后我运行

bundle

要检查宝石是否消失,我键入

To check that the gem is gone, I type

bundle show

但我仍然看到那里的宝石

But I still see the gem there

...
* some_gem
* gem_I_dont_want
* another_gem

我不了解捆绑包的工作原理吗?还有什么我想做的呢?

Am I not understanding how bundle works? Is there something more I'm suppose to do?

推荐答案

gem可能是另一个gem的依赖项,可以解释其存在在 bundle show 中。

The gem could be a dependency of another gem which would explain its presence in bundle show.

如果该宝石在Gemfile.lock文件中的另一个宝石下方出现了缩进,则表明之所以仍将其包括在内是因为它是一个依赖项。

If the gem appears indented beneath another gem within the Gemfile.lock file then it would indicate that it's included still because it's a dependency.

这篇关于如何从Rails项目中删除宝石?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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