[Document] Write Rails Guide about Deployment?

Can you guys write a new guide about the Basic of Rails Deployment? I can’t find any on http://guides.rubyonrails.org/

I know there are many tutorial on Google. but I hope just official guide can have a short intro about how many web server there are, like puma, unicorn, passanger, rainbow…, maybe a bit of history, like Mongrel and thing like that.

Would that be nice?

1 Like

Hi Zheng,

Thanks for bringing this up! I was just thinking about contributing to this myself :slight_smile: I am currently checking the style guide and will be writing soon.

2 Likes

This has been discussed in the past. Problem is, it is a too broad topic.

Understandable yet we need to start somewhere. For instance in the Rails 7.0 demo video, Heroku is picked as a deployment choice. In the desired deployment guide, how about we cover heroku and Capistrano? We can label them as recommendations for beginners etc(following convention over config motto).

1 Like

Rails should not duplicate or tunnel Heroku’s or Capistrano’s documentation. Both tutorials and references belong to Capistrano’s documentation. That’s the official one, and the one that is kept in sync with the project for certain.

Same for Heroku. To deploy in Heroku, you read Heroku’s documentation.

3 Likes

Makes sense. Thanks for the clarification.

To help guide people, why not have a deployments section of the Rails docs that links to high quality tutorials for the most popular platforms, like Heroku, AWS Lambda, Cloud Run on GCP, etc?

1 Like

because of maintainability about syncing documents between rails docs and others.

Just to make sure we’re on the same page here, by linking, I mean linking to tutorials maintained by others, not maintaining tutorials here. For example, linking to Heroku’s tutorial on deploying Rails.

Until now, my deployments were done on Heroku (git push heroku main) or via a CI/CD script running on GitLab (git push origin main).

I would be interested by a solution involving packaging the Rails app in Docker (that’s the easy part) and pushing the new version on a Docker environment (for instance Digital Ocean or AWS).

Yup, I mean that is overhead to maintain links as well. guides of Heroku and etc cover how to deploy rails. e.g. Getting Started on Heroku with Rails 6.x | Heroku Dev Center

my answer is the detail explanation from fxn answer.

Quick Update:

I originally post this question on May 2016, now it’s 2022 Jan. At the beginning I was deploying onto baremetal which mean I setup all the neccessary enviroment(Ruby/Node.js/etc) on my Linux(Ubuntu) server and using tools like Capistrano to deploy.

But right now we are using Docker to unify all the enviroment, now it become so much easier than before.

We are using AWS with ECS to deploy our container. (instead of using Docker Swarm or K8S)

Docker made my life so much easier. Heroku is nice but kinda expensive and not working in China region.

I think we can write a little guide on using Docker with Rails.

Honestly, I don’t buy the “too broad topic” argument. From my point of view, Rails Guides should definitely contain a Deployment section.

  • Rails Doctrine says Rails should be “optimized for programmer happiness”. Programmers are not happy when they don’t know how to deploy
  • Rails Doctrine says “The menu is omakase”. Why not apply this principle to deployment? Pick some default ways of deployment and lift the programmer’s burden to decide by himself
  • In the past, Rails indeed provided some deployment guidelines. Until 2016, there was a deployment section on the home page. Until 2019, Capistrano was included in the Gemfile
  • Most of Rails competitors manage to include some deployment sections in their guides

A while ago, I’ve written a more in-depth blog post about this topic.

2 Likes