Ruby on Rails新手 [英] Ruby on Rails Newbie

查看:79
本文介绍了Ruby on Rails新手的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我继承了一个有问题的Ruby on Rails应用程序.我在阅读有关Rails的书时已经过了一半,但是还没有看到一些问题的答案.

I've inherited a Ruby on Rails application that has a problem. I'm half way through some books on Rails, but haven't seen the answer to some questions yet.

  1. 备份应用程序的最佳方法是什么?我可以只是tar -cvzf app.tgz app吗?我还不知道该应用程序是否具有sqlite3数据库或连接到数据库服务器.

  1. What is the best way to backup the application? Can I just tar -cvzf app.tgz app? I don't know yet if the app has a sqlite3 database or connects to a db server.

将应用程序移动到另一台服务器进行测试的最佳方法是什么?再次,我不知道它是sqlite3还是支持它的数据库服务器.

What's the best way to move the application to another server for testing? Again, I don't know if it's sqlite3 or a db server backing it.

谢谢

迈克尔

更新:是的,我将使用版本控制.现在没有任何东西.我想尝试解决的问题是:应用程序目录的可移植性;如果我想将整个应用程序移到另一台计算机上,是否还需要携带其他物品?

Update: Yes, I will be using version control. There isn't any right now. The question I think I was trying to get at is: how transportable is the app directory; if I want to move the entire application to another computer do I need to take anything else along with me?

推荐答案

我来看看Capistrano-这是选择的部署/管理工具.

I would have a look at Capistrano - this is the deployment/management tool of choice.

从本质上讲,它将从源代码控制中获取您的应用程序,部署和配置目标服务器,并运行任何数据库迁移.

At it's core, it will grab your application from source control, deploy and configure the destination server, and run any database migrations.

您可以使用它指向多个服务器(例如测试,登台和生产).

You can use it to point to multiple servers (such as test, staging and production).

要回答您的实际问题,您可以通过简单地复制Rails目录来移动您的应用程序(注意:不是 just 应用程序目录,而是父目录).您的数据库将需要单独管理-对于sqlite,您只需获取文件即可,如果您使用的是MySQL,则可能会转储数据库并在下一台服务器上重新配置.

To answer your actual question, you can move your app by simply copying the Rails directory (note: not just the app directory, but the parent directory as well). Your database will need to be managed separately - in the case of sqlite, you can just grab the files, if you are using MySQL you would probably dump the database and reconfigure on the next server.

这篇关于Ruby on Rails新手的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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