Rails Framework Official Website
Rails Framework Official Website

What is Rails?

Rails is a web framework developed based on the Ruby language. It is well-received by startups around the world. With its perfect functions and ease of use it is a favorite of full stack engineers.

21YunBox provides a very simple Rails project deployment method like Heroku. You can deploy on the 21YunBox by using the Ruby runtime environment.

How to Deploy Ruby Rails Project to Server

  1. Register to become a 21YunBox member
  2. Create a PostgreSQL database
  3. In Gitee Fork Rails 6 start template
  4. Create a Cloud Service on 21YunBox, and allow 21YunBox to access your code base
  5. Create with the following configuration



Build command

Create an file in the root directory of rails with the following content, Then during the build process, execute:

# command executed
bundle install
bundle exec rake assets:precompile
bundle exec rake assets:clean
bundle exec rake db:migrate

Start command:

bundle exec puma -C config/puma.rb

Click Advanced Configuration to configure environment variables:

RAILS_ENV production
PORT 10000, 21YunBox default reads port 10000
DATABASE_URL In Cloud Database, click Database URL to get
RAILS_MASTER_KEY Generated by bin/rails credentials:edit

In seconds, your rails service can be accessed at

 Screenshot of successful deployment of Rails startup template
Screenshot of successful deployment of Rails startup template

Why Choose 21YunBox?

21YunBox specializes in helping foreign businesses to host their websites in China. We deliver everything you and your team needs to build, run, and scale websites and apps in China.

Talk to an Expert

Create Professional Solutions for Your Industry and Business