Reference: https://github.com/HK-WDI-November-2014/student-course-everything/blob/master/simple-rails-app.md
- Gemfile: A file that defines libraries the app is using
- bundle install: Based on the Gemfile, install all the libraries
- You should run
bundle install
every time you modify your Gemfile - A gem is a library for Ruby
- RubyGems.org is a place to find and download Ruby gems
- rails new
<name>
-BT - Change the following in the Gemfile
# use '4.1.6' for heroku
gem 'rails', '4.1.6'
# Use postgresql as the database for Production
gem 'pg', group: :production
# Use sqlite3 as the database for Development
gem 'sqlite3', group: :development
# Bootstrap
gem 'bootstrap-sass', '~> 3.3.0'
# Debugging tools
gem 'better_errors'
gem 'binding_of_caller'
-
Run
bundle install
-
Uncomment and change in
routes.rb
root 'static_pages#index'
- Generate a controller called
static_pages
rails generate controller static_pages
-
Add a view called
index.html
understatic_pages
view folder -
Change
application.css
toapplication.css.scss
-
Add the following line to the end of
application.css.scss
@import "bootstrap-sprockets";
@import "bootstrap";
- In
config/production.rb
, change the following
config.serve_static_assets = false
to
config.serve_static_assets = true
- heroku create
- Commit your changes
- git push heroku master