Ruby on Rails Tutorial the first chapter of Heroku deployment

Source: Internet
Author: User
Tags version control system ruby on rails

1, Purpose: Use Heroku to deploy the development environment to the production environment. Heroku is dedicated to deploying rails and other Web applications, and the process of deploying rails applications is straightforward-as long as the source code is incorporated into the GIT version control system.

2. Build Heroku Deployment Environment

(1) Heroku use PostgreSQL database, so to add PG to the production group, so that rails can communicate with PostgreSQL, at the end of the Gemfile file, add the following code:

' PG ' ' 0.17.1 '  'rails_12factor'0.0.2'end

(2) Run the Bundle install command and specify the--without producttion option to prohibit local installation of gems (i.e. PG and rails_12factor) used in the production environment

$ bundle Install--without production

$ git commit-a-M "Update Gemfile.lock for Heroku"

(3) Register and configure Heroku account

Heroku Website: https://signup.heroku.com

(4) Check if the system has Heroku installed

$ Heroku Version

(5) Log in using the Heroku command and then add the SSH key

$ Heroku Login #要求输入Heroku注册是用的邮箱和密码

$ Heroku Keys:add

(6) Create a new application in Heroku

$ Heroku Create #结果中的网址即访问个人项目的网址

(7) Use Git to push the main branch to Heroku:

$ git push Heroku Master

Deployment Success!

Ruby on Rails Tutorial the first chapter of Heroku deployment

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.