How to deploy Rails app with Twitter Bootstrap on Heroku

1. First you need create demo application:
rails new demo
rails g scaffold product title:string price:integer
 then you should, enter into created app directory "demo" :
cd demo

2. Add the following gem into your Gemfile
gem 'pg'
gem 'rails_12factor', group: :production



Uncomment in Gemfile :
 # gem 'sqlite3', group: :development

3. put this line underneath the other config.assets lines inside config/application.rb:
config.assets.initialize_on_precompile = false

4. Download compiled version of Bootstrap from http://getbootstrap.com/getting-started/#download

5. From downloaded Bootstrap file copy each file according to it's type:
bootstrap-3.2.0/css/bootstrap*  -> app/assets/stylesheets
bootstrap-3.2.0/js/*                    -> app/assets/javascripts
bootstrap-3.2.0/fonts/*               -> app/fonts/
Run on terminal:
rake assets:clean assets:precompile

6. Run on terminal


gem  install heroku
heroku login
heroku create
git init
git add .
git commit -m "first commit"

git push heroku master
heroku rake db:migrate
you can run command remotely on heroku by typing 'heroku' before your command7. Thats all! Enjoy your app.

Comments