"Adding deletions" may sound weird, but if you think of a version control system as keeping track of changes, it might make more sense.

Type this in the terminal:

git commit -m "initial commit"

Expected result:

a lot of lines like create mode 100644 Gemfile

Type this in the terminal:

git log

Expected result:

(Your git name and "initial commit" message.)

Step 2: Deploy your app to Heroku

Step 2.1: Create a Heroku application from this local Rails application.

The very first time you use heroku you must enter your Heroku email address and password. Your password may not be shown as you type it, but don't worry, it's being entered! If you have already provided your credentials before, you won't be prompted for them again.

Heroku apps are automatically given lyrical names that look like '[adjective]-[noun]-[number]'. Each name is different.

Type this in the terminal:

git remote show

Expected result:

heroku

If you get messages here complaining about public keys it's probably due to some confusion with SSH key usage by another app on your computer. Call a volunteer over to help you figure it out. Luckily this only needs to be done the first time you create a Heroku app.

Step 2.2: Prepare your rails app for deploying to Heroku

Launch your text editor and open the "Gemfile" file located inside of your test_app folder. (On Windows, this should be in C:\Sites\railsbridge\test_app and on Linux/OS X, it should be under ~/railsbridge/test_app.)

When you saved the file, your text editor may have added colors to the code, much like the example above. It recognizes the file contains Ruby, and will mark up different kinds of words with different colors. This is called "syntax highlighting", which makes it easier to read code.

Why Sqlite (sqlite3) and PostgreSQL (pg)?

SQLite and PostgreSQL are different kinds of databases. We're using SQLite for our development and test environments because it's simple to install. We're using PostgreSQL in our production environment because Heroku has done the hard work of installing it for us and it's more powerful than SQLite. We have separate test, development and production databases by default in Rails.

Type this in the terminal:

gem install bundler

Approximate expected result:

Successfully installed bundler-1.14.3
1 gem installed

The greyed-out text may differ and is not important.

Type this in the terminal:

bundle install --without production

Again, wait for the console prompt, and look for the 'Bundle complete!' message just above.

Step 2.3: Set the root route

Use your editor to open the file routes.rb (C:\sites\railsbridge\test_app\config\routes.rb or ~/railsbridge/test_app/config/routes.rb) and find the line containing:

Rails.application.routes.draw do

After this line, add a new line with the following:

root 'drinks#index'

Save the file.

Step 2.4: Add the changes to git

Before running the following command (to add to your local git repository), make sure that you are in the test_app directory.

Type this in the terminal:

git add .

Type this in the terminal:

git commit -m "Updates for heroku deployment"

Step 2.5: Deploy (push) to heroku

Type this in the terminal:

git push heroku master

It may ask: "The authenticity of host 'heroku.com (75.101.145.87)' can't be established. RSA key fingerprint is 8b:48:5e:67:0e:c9:16:47:32:f2:87:0c:1f:c8:60:ad. Are you sure you want to continue connecting (yes/no)?" Type yes and hit enter.