Code Monkey home page Code Monkey logo

heroku_deploy_lab's Introduction

Deploying Ruby on Rails to Heroku Lab

In this lab we will learn to use Heroku, a cloud hosting platform that supports Ruby on Rails.

This application has been pre-built for you and there is no need to change anything with the application itself.

The application is a simple CRUD app built around Posts

Learning Goals

References for when you hit problems

Instructions

The project is pre-made for you, and there is no need for you to change any of the Rails code. Do not change any of the Rails code until you have successfully deployed the application to Heroku.

  1. Fork and clone this project from Github to your laptop.
  2. Create a free Heroku account on the Heroku website. You will need to confirm your email address, and then provide Heroku with a password which you should remember.
  3. Download and install the Heroku Toolbelt for your operating system.
  4. Change into the directory for this heroku_deploy_lab Rails project in the bash prompt
  5. From this bash prompt, run heroku login. Provide Heroku with the email and password that you set in step 2.
  6. Run heroku create. This will setup a new application remote for you. This does not automatically deploy the application. You only need do this once per application.
  7. Look at the Gemfile and note that I have included the pg gem for the production environment (Heroku is our production environment) on line 11. I have moved the sqlite3 gem into the test and development environment groups on line 14. You do not have to change any files for the application to deploy.
  8. Run git push heroku master. This will take around 2 minutes to fully run.
  9. Run heroku run rake db:migrate to run our database migrations on Heroku.
  10. Run heroku open to view your newly deployed site in the browser.
  11. If you would like to run it locally, run rake db:migrate and then rails s.
  12. Any changes you make to the code will not show up on Heroku until you have created a new commit and pushed them to the heroku remote on the master branch.

heroku_deploy_lab's People

Contributors

jamalp avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.