Skip to content

Commit

Permalink
Add step for including pg in the Gemfile.
Browse files Browse the repository at this point in the history
When following the instructions step by step, Heroku is broken because
the `pg` gem is not installed. This commit adds a step for doing so in a
logical place and provides a brief introduction to the purpose of the
Gemfile.
  • Loading branch information
nuclearsandwich committed Nov 19, 2011
1 parent ee250fd commit 712f0d7
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion lessons/11.yaml
Expand Up @@ -3,10 +3,26 @@ goal_title: Commit and push to heroku
goal: | goal: |
We just added a whole new feature. Let's push it to heroku so our We just added a whole new feature. Let's push it to heroku so our
friends can play with it. friends can play with it. In order to do so, we need to make a
small change to our `Gemfile`
steps: | steps: |
Open the file called `Gemfile` in KomodoEdit, or your preferred editor
and find the line beginning:
gem 'sqlite3'
Remove this line and replace it with:
group :development do
gem 'sqlite3'
end
group :production do
gem 'pg'
end
In your terminal, try: (**note:** there is a period after the word In your terminal, try: (**note:** there is a period after the word
add in the first line) add in the first line)
Expand All @@ -17,6 +33,11 @@ steps: |
explanation: | explanation: |
* The Gemfile is a list of all the Ruby libraries your application needs.
what we've declared here, is that we want to use the `sqlite3` library
while we're developing on our computer (the development group) but when
deploying to heroku (the production group) we want to use the `pg` library,
which is made for the type of database that Heroku uses.
* We've done the first three steps before, so we won't go over that again... * We've done the first three steps before, so we won't go over that again...
* `heroku rake` executes a rake task on your server, in this case, * `heroku rake` executes a rake task on your server, in this case,
`db:migrate`, just like you did locally. `db:migrate`, just like you did locally.

0 comments on commit 712f0d7

Please sign in to comment.