简体   繁体   English

从Windows机器部署Rails

[英]Rails deployment from a windows machine

I'm a rails novice and just finished my first rails app(as far as I can tell). 我是一个铁杆新手,刚刚完成了我的第一个rails应用程序(据我所知)。 Now I'm at the deployment stage and find myself utterly confused--especially because I'm deploying from a windows machine. 现在我处于部署阶段,发现自己完全糊涂了 - 特别是因为我正在从Windows机器上部署。

I bought the pragmatic book on deployment and it seems a little out of date since they're recommending subversion instead of Git. 我买了一本关于部署的实用书,看起来有点过时,因为他们推荐颠覆而不是Git。

What would be the easiest deployment method these days for someone doomed to use windows? 如今有人注定要使用Windows的最简单的部署方法是什么? Are there any good up-to-date tutorials on deployment from Windows? 有关Windows部署的最新教程吗?

The best way right now is to use mod_rails on your server, and deploy using a tool called Capistrano. 现在最好的方法是在服务器上使用mod_rails,并使用名为Capistrano的工具进行部署。 Capistrano is windows compatible and I use it on windows myself all the time. Capistrano是Windows兼容的,我一直在Windows上使用它。

Here's a guide that explains how to set up and use both tools: http://cjohansen.no/en/rails/multi_staging_environment_for_rails_using_capistrano_and_mod_rails 以下是解释如何设置和使用这两种工具的指南: http//cjohansen.no/en/rails/multi_staging_environment_for_rails_using_capistrano_and_mod_rails

If you want an even easier set up, check out http://www.heroku.com . 如果您想要更简单的设置,请查看http://www.heroku.com They are a great Rails hosting company and they provide an excellent set of tools to set up and deploy your rails applications to their server. 他们是一家出色的Rails托管公司,他们提供了一套出色的工具来设置和部署rails应用程序到他们的服务器。 It's free to get started, but you will need to pay a little bit if your site grows. 它可以免费入门,但如果您的网站增长,您需要支付一些费用。 They are 100% windows compatible, since deployment basically consists simply of you pushing to a git repository on their server. 它们是100%窗口兼容的,因为部署基本上只是你推送到他们服务器上的git存储库。

Good luck! 祝好运!

If you list your specific issues it might be easier to help. 如果列出您的具体问题,可能会更容易提供帮助。 If you want reassurance, here is one; 如果你想要放心,这里就是一个; I use Windows for Rails development, and I haven't had any major issues(barring lack of support for some gems). 我使用Windows进行Rails开发,我没有遇到任何重大问题(除非缺少对某些宝石的支持)。

To interact with Git repository I use this windows client 要与Git存储库交互,我使用这个Windows客户端

Capistrano is pretty much the standard way to manage deployment for a Rails app. Capistrano几乎是管理Rails应用程序部署的标准方法。 It's been a while, but IIRC Capistrano has some trouble working on Windows in some situations (related to ssh). 已经有一段时间了,但是在某些情况下(与ssh相关),IIRC Capistrano在Windows上工作有些麻烦。 If you can set up Cygwin on your Windows, it should make things a bit easier. 如果你可以在Windows上设置Cygwin,它应该会让事情变得容易一些。 Assuming you're deploying to a Unix/Linux environment, it shouldn't matter much whether you're using git or svn, as far as your local development environment is concerned. 假设您正在部署到Unix / Linux环境,那么就您当地的开发环境而言,使用git还是svn并不重要。 The server side of Capistrano (really just the the remote shell) is responsible for connecting to your git repo and fetching it into your deployment environment. Capistrano的服务器端(实际上只是远程shell)负责连接到您的git仓库并将其提取到您的部署环境中。

Another good option that you might want to investigate is running Linux inside of VirtualBox or VMWare on your Windows machine; 您可能想要研究的另一个好选择是在Windows机器上运行VirtualBox或VMWare中的Linux; in general I find Ruby/Rails development to be more hassle-free when working in a unix environment. 总的来说,我发现Ruby / Rails开发在unix环境中工作时更加轻松。

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

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