Ruby: Setting up a staging environment

This documentation is part of the Advanced usages guide. You can view the complete guide here: Going further with your Ruby deployments.

👋 Welcome to the Stackhero documentation!

Stackhero provides a ready-to-use Ruby cloud solution offering a range of advantages, including:

  • Deploy your application within seconds using a simple git push.
  • Use your own domain name and benefit from the automatic configuration of HTTPS certificates for enhanced security.
  • Take advantage of automatic backups, one-click updates, and clear, transparent, and predictable pricing.
  • Enjoy optimal performance and enhanced security thanks to a private, dedicated infrastructure.

Save time and make your life easier: it only takes 5 minutes to try Stackhero's Ruby cloud hosting solution!

A staging environment is a best practice to use alongside your development and production environments. It replicates your production environment so you can test updates and changes before they go live.

A staging environment must closely mirror the production environment.

However, ensure that the staging environment uses a clone of the production database rather than the actual production database.

If your Ruby service is linked to a database or other services, recreate them in the new <Project> - Staging stack.

To set up a staging environment on Stackhero, follow these steps:

  1. On the Stackhero dashboard, rename your existing stack from <Project> to <Project> - Production. For example, if your project is called Chat Bot, rename the stack to Chat Bot - Production.
  2. Create a new stack called <Project> - Staging. Using the previous example, this would be Chat Bot - Staging.
  3. Start a Ruby service within the staging stack.
  4. Retrieve the value of the git remote command and follow the instructions in the Deploying to staging environment section.

Following these steps will give you a properly configured staging environment to test and verify updates before they reach production.