Rails and bootstrap

How to install bootstrap on your Rails 5+ project

  • After quite a bit of Googling and some failed attempts I landed here.

  • The gist is to do the following:

    1. Put the following into your Gemfile

      gem 'bootstrap-sass', '3.3.7'
    2. Run

      bundle install
    3. Create a CSS file

      touch app/assets/stylesheets/custom.scss
    4. Import bootstrap and bootstrap-sprockets into the file you just created

      @import "bootstrap-sprockets";
      @import "bootstrap";
  • You’re now running bootstrap!