Skip to content

Instantly share code, notes, and snippets.

@hone
Created April 18, 2012 12:44
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save hone/2413351 to your computer and use it in GitHub Desktop.
Rails Girls Heroku Instruction

Get Heroku

Follow steps 1 through 3 of the quickstart guide to sign up, install the toolbelt, and login.

Deploying your app

Updating our database

First, we need to get our database to work on Heroku, which uses a different database. Please change the following in the Gemfile:

gem 'sqlite3'

to

group :development do
  gem 'sqlite3'
end
group :production do
  gem 'pg'
end

Run bundle install --without production to setup your dependencies.

Version Control

We need to add our code to version control. You can do this by running the following in the terminal:

git init
git add .
git commit -m "initial commit"

COACHES: This would be a good time to talk about version control systems and git.

Deploying

We need to create our heroku app by typing heroku create --stack cedar in the terminal and see something like this:

Creating evening-sky-7498... done, stack is cedar
http://evening-sky-7498.herokuapp.com/ | git@heroku.com:evening-sky-7498.git
Git remote heroku added

In this case "evening-sky-7498" is your app name.

Next we need to push our code to heroku by typing git push heroku master

Next we need to migrate our database like we did locally: heroku run rake db:migrate

You can now hit the app based on the url. For this example app, you can go to http://evening-sky-7498.herokuapp.com/

@vesan
Copy link

vesan commented Apr 26, 2012

Latest version of this guide can be found at http://guides.railsgirls.com/heroku/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment