如何从Ruby on Rails应用程序中删除gem? [英] How to remove gem from Ruby on Rails application?

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

问题描述

我在Rails应用程序(devise)上安装了一个gem。在我安装好gem之后,我意识到我不需要它。



我想删除它在应用程序中创建的gem及其依赖项和文件。换句话说,我想将系统恢复到之前的状态。我怎样才能做到这一点? (我正在使用Ruby on Rails 3。)

解决方案

Devise使用一些生成器生成视图并将其需要的东西放入应用程序。如果你已经运行了这个生成器,你可以很容易地使用它来撤消它。

  rails destroy< name_of_generator> 

卸载gem的工作如其他文章中所述。

I have installed a gem on my Rails application (devise). After I installed the gem, I realized that I don't need it.

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

The uninstallation of the gem works as described in the other posts.

这篇关于如何从Ruby on Rails应用程序中删除gem?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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