Deploying on Heroku
Heroku is very convenient for quick deployment and small apps. Deploying a 3.2 rails app can be trickier than earlier versions. The guides here and here gives the detailed instructions. Here is the summary:
- PostgreSQL as the database is required. When creating the app, add “-d=postgresql” at the end. For example, creating an app called demo, write “rails new demo -d=postgresql” in the console.
- Add “config.assets.initialize_on_precompile = false” at the end of config/application.rb
- Compile assets locally. First set the environment variable to production using “set RAILS_ENV=production“, compile using “bundle exec rake assets:precompile.” Don’t forgot to set RAILS_ENV back to development once you’re done.
- If you haven’t already, initialize git (“git init“), add all changes (“git add .“), and commit (“git commit -am ‘init’ “).
- Create the heroku app (“heroku create“) and deploy (“git push heroku master“)!





