如何卸载 Ruby on Rails 应用程序?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1485059/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I uninstall a Ruby on Rails application?
提问by Justicle
I've just worked through the Rail example supplied by Apple: http://developer.apple.com/Tools/developonrailsleopard.html
我刚刚完成了 Apple 提供的 Rail 示例:http: //developer.apple.com/Tools/developonrailsleopard.html
Now that I'm done, I'd like to clean this up and remove the web service, database etc. Obviously I still want the RoR stack in place.
现在我已经完成了,我想清理它并删除 Web 服务、数据库等。显然我仍然希望 RoR 堆栈到位。
How? Can I do this using rake?
如何?我可以用耙子做这个吗?
回答by Jarrod
Just delete it; the whole folder that was created by the rails command you started with, in this case the expenses folder. It's all self-contained.
删除它就行了;由您开始使用的 rails 命令创建的整个文件夹,在本例中为费用文件夹。这一切都是自成一体的。
The rails command creates a copy of the framework, so it'll still be installed.
rails 命令会创建框架的副本,因此它仍将被安装。
回答by RAJ
You need to drop your related database and then delete the app directory
您需要删除相关数据库,然后删除应用程序目录
# from app directory
rake db:drop
cd .. && rm -rf <app_directory_name>
Rails generator command creates a copy of the framework. The app directory id self contained. Deleting it is enough. If you are using sqliteas your database then you can skip first command.
Rails 生成器命令创建框架的副本。应用程序目录 ID 自包含。删除它就足够了。如果您sqlite用作数据库,则可以跳过第一个命令。
回答by Esmaeil MIRZAEE
For the sake of safety, at first, it's essential to drop the tables in the database and finally deleting the app's directory.
为了安全起见,首先必须删除数据库中的表,最后删除应用程序的目录。
rake db:drop
cd /root/of/app_directory/
rm -rf app_directory
Note: In some document(I am not sure about the consequences), I saw another command for dropping the database which is rails db:drop.
注意:在某些文档中(我不确定后果),我看到另一个用于删除数据库的命令是rails db:drop.

