如何从 Ruby on Rails 应用程序中删除 gem? [英] How to remove gem from Ruby on Rails application?
问题描述
我在我的 Rails 应用程序(设计)上安装了一个 gem.安装 gem 后,我意识到我不需要它.
I have installed a gem on my Rails application (devise). After I installed the gem, I realized that I don't need it.
我想删除 gem、它的依赖项以及它在我的应用程序上创建的文件.换句话说,我想将系统恢复到宝石之前的状态.我怎样才能做到这一点?(我正在使用 Ruby on Rails 3.)
I want to remove the gem, its dependencies and the files it created on my application. In other words, I want to restore the system to what it used to be before the gem. How can I do this? (I'm using Ruby on Rails 3.)
推荐答案
Devise 使用一些生成器来生成视图并将它需要的东西放入您的应用程序中.如果你已经运行了这个生成器,你可以很容易地撤销它
Devise uses some generators to generate views and stuff it needs into your application. If you have run this generator, you can easily undo it with
rails destroy <name_of_generator>
gem 的卸载工作如其他帖子中所述.
The uninstallation of the gem works as described in the other posts.
这篇关于如何从 Ruby on Rails 应用程序中删除 gem?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!