How to remove gems from Rails project?

℡╲_俬逩灬. 提交于 2019-12-10 21:36:46

问题


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
....

Then I run

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?


回答1:


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

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.




回答2:


There is still this gem until you clean your Bundle using:

bundle clean

But you don't need to fear. It mean that this package is installed but it wouldn't load into your app until you let it.



来源:https://stackoverflow.com/questions/17157375/how-to-remove-gems-from-rails-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!