0

I've been self teaching myself ruby and rails for the past year and finally have an app ready that I want to deploy out to the world. While I can relatively easily deploy to Heroku, I would rather learn how to configure things myself but I have very little understanding of web servers and what all is needed to deploy things. I've done a lot of research and it seems like most rails apps are deployed with some combination of unicorn/puma with nginx and Capistrano. I was hoping someone had resources or could explain the bare-bones basics of these tools.

I am mostly confused about unicorn/puma vs nginx. They all seem like web-servers, but clearly nginx is different from unicorn. I have no idea how they interact with each other in order to serve web applications.

I know Capistrano is used to deploy code, but I have no idea what that actually means.

Lastly, how do these tool interact with hosts such as AWS or digital ocean.

Any help or resources that can get me started would be appreciated.

xeroshogun
  • 1,062
  • 1
  • 18
  • 31
  • Nginx is reverse-proxy that communicates to Rails through Unicorn. Intercommunication based on linux domain sockets. Capistrano just delivers the code on server. – Anatoly Mar 29 '15 at 00:57

3 Answers3

2

This is the best overview that helped me understand the different options that are available: Ruby on Rails Server options. It covers most app servers and how they compare practically, and it covers Capistrano at the end.

Personally, I use AWS OpsWorks for my production environment (they have a Free Tier available for a year) which has a default Rails on Nginx or Apache app server layer: http://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-rails.html.

Community
  • 1
  • 1
readyornot
  • 2,783
  • 2
  • 19
  • 31
1

I found the Deploying Rails book to be a comprehensive resource for all things related to rails deployment. Unfortunately it is out of print. I doubt if it is too outdated even if it was written for rails 3.

There are quite a few good blogposts; one I found very helpful was http://robmclarty.com/blog/how-to-deploy-a-rails-4-app-with-git-and-capistrano

Note: The above blogpost uses capistrano version 2.14.2.

I would advice following the same steps to understand capistrano, and then use http://capistranorb.com/documentation/upgrading/ for upgrading to capistrano version 3.x

Prakash Murthy
  • 12,923
  • 3
  • 46
  • 74
0

This guide is pretty helpful and succinct
Using Capistrano 3, RVM & Puma https://coderwall.com/p/ttrhow/deploying-rails-app-using-nginx-puma-and-capistrano-3

Samwise
  • 206
  • 3
  • 5