How To upload a Rails app to Heroku
1 First, configure your app to use PostgreSQL: Edit your Gemfile to change the line :
To this:
and execute:
2 Second, use git to create a local repository:
3 Third, install Heroku gem, if it isn’t installed yet:
4 Now create the Heroku app:
5 To rename the default Heroku app name:
6 To create a custom domain for the app:
Next steps
- Develop and test locally
- Commit to git every change
- Push to Heroku with: $ git push heroku master
Utilities
- Rename Heroku app $ heroku rename
- Custom domain $ heroku addons:add custom_domains $ heroku domains:add
- Add the following text to Gemfile to user Thin server instead of WebBrick: gem ‘thin’
- How to install PostgreSQL on Mac
- Sample file config/database.yml to use PostgreSQL:
For Heroku production: entry is not necessary, because Heroku assigns one PostgreSQL to each app.