简体   繁体   English

如何卸载Ruby on Rails应用程序?

[英]How do I uninstall a Ruby on Rails application?

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? 我可以用耙子做吗?

Just delete it; 只需删除它即可; the whole folder that was created by the rails command you started with, in this case the expenses folder. 由您开始使用的rails命令创建的整个文件夹,在本例中为支出文件夹。 It's all self-contained. 全部都是独立的。

The rails command creates a copy of the framework, so it'll still be installed. rails命令创建框架的副本,因此仍将安装它。

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. Rails generator命令创建框架的副本。 The app directory id self contained. 应用目录ID本身包含。 Deleting it is enough. 删除就足够了。 If you are using sqlite as your database then you can skip first command. 如果使用sqlite作为数据库,则可以跳过第一个命令。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM