A super simple Ruby on Rails starter guide 2 - releasing an app using Heroku

I wrote a RoR starter guide the day before yesterday :)

A super simple Ruby on Rails starter guide 1 - Only 30 mins to start! - aki note

I wonder which to write for the next entry "writing code with eclipse IDE" or "releasing an app using Heroku". Finally I decided to write the latter topic first. It might be fun if you can show your app to the world.

So, let's start :D

■ Create an account on Heroku

Heroku is a cloud platform that hosts web apps. For small apps, you can use their service for free.

Cloud Application Platform | Heroku

Let's start by creating your account.

https://api.heroku.com/signup


What we do for next is like...

(local repository) --- internet ---> (remote repository on Heroku)

  1. Setup local repository
  2. Setup remote repository on Heroku
  3. Deploy the app!

I'll explain the 3 steps in detail.

■ Setup local repository

To deploy your app, Git setting is needed. Git is a version control system.

Git

Don't mind about Git too much. You can learn it later. Git itself has already been installed on your computer by Railsinstaller.

Let's start from initializing your local repository for the app. Open command prompt and type following commands.

> cd [your app directory]
> git init

Add and commit the code to the local repository.

> git add .

# Don't forget the last period "." :D

> git commit -m "[Some message for commit. You can complain something here :D]"

■ Setup remote repository on Heroku

For the first time, you need to install Heroku CLI to communicate with Heroku on command prompt. Download an installation file and install it on your computer.

The Heroku CLI | Heroku Dev Center

Create a repository on Heroku.

> heroku create [app name]

for more detail see: Creating Apps from the CLI | Heroku Dev Center

OK. Now it's time to deploy your app on Heroku!

■ Deploy the app

Type the following command:

> git push heroku master

... That's all!

Open the url "http://[app name].heroku.com" :) You may see your app.


Happy coding :D