简体   繁体   English

将Rails应用程序部署到VPS

[英]Deploying Rails app to a VPS

I've been building my first site using Rails, and I want to get it live. 我一直在使用Rails构建我的第一个站点,我希望能够实现它。 Up to now I've only ever put a site live by just dropping all the files onto my VPS via FTP, and I know that's not how it works with a Rails app. 到目前为止,我只是通过FTP将所有文件放到我的VPS上来实现网站直播,我知道这不适用于Rails应用程序。

What I don't know is where to even begin with making sure Rails is installed on my VPS (it's Linux based, I bought a package from Webfusion), and then how to deploy it and get it all running properly. 我不知道的是从哪里开始确保Rails安装在我的VPS上(它是基于Linux的,我从Webfusion购买了一个包),然后是如何部署它并让它全部正常运行。 My VPS has Plesk 10 installed on it, and from what I've read I need to install Rails alongside Plesk? 我的VPS上安装了Plesk 10,从我读过的内容我需要和Plesk一起安装Rails吗? I may have the wrong end of the stick, so don't hold back if I'm saying stupid things. 我可能有一个错误的结束,所以如果我说愚蠢的话,不要忍住。

I realise this is a really green question to ask, but I've scoured forums looking for a solution I can understand and come up with nothing, so hoping someone here can help. 我意识到这是一个非常绿色的问题,但我已经在寻找一个我能理解的解决方案并且没有任何想法的论坛,所以希望有人可以提供帮助。

Thanks in advance! 提前致谢!

I've never used a control panel like Plesk but I do have a VPS at linode.com. 我从未使用像Plesk这样的控制面板,但我在linode.com上有一个VPS。 To get my rails sites up and running I got help from a smashingmagazine blog post and pro railscast episode . 为了让我的rails网站运行起来,我从粉碎杂志博客帖子专业的railscast节目中得到了帮助。 The railscast episode is not free but it has great info. railscast剧集不是免费的,但它有很好的信息。

There are a lot of details with each step of getting a rails web server running on a VPS so please look at the blog or railscast video. 在VPS上运行rails web服务器的每一步都有很多细节,所以请查看博客或railscast视频。 But a high level overview of the steps is: 但是对这些步骤的高级概述是:

  1. install rvm 安装rvm
  2. install ruby and ruby gems 安装红宝石和红宝石宝石
  3. install rails 安装导轨
  4. install a rails web server (a common option is passenger and nginx) 安装rails web服务器(常见选项是passenger和nginx)
  5. install a database (postgres is a common option) 安装数据库(postgres是常用选项)
  6. capistrano for deployment capistrano用于部署

I wrote an ebook an this topic. 我在这个主题上写了一本电子书。 After explaining how to set up a server from scratch it focuses on how to deploy an application manually, helping you to understand how this process works under the hood (I left automation out intentionally). 在解释了如何从头开始设置服务器之后,重点介绍了如何手动部署应用程序,帮助您了解这个过程是如何工作的(我有意无意地离开了自动化)。

It covers a nginx/Unicorn/MySQL/rbenv setup. 它涵盖了nginx / Unicorn / MySQL / rbenv设置。 If you think that's something for you, you can get it here (it's free for people on my mailing list). 如果您认为这适合您,您可以在此处获取(我的邮件列表上的人可以免费使用)。

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

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