Bootstrap 3.2 was released on June 26, 2014 and the bootstrap-sass gem was released immediately afterward. Bootstrap 3.2 contains many new features and bug fixes but the biggest impact for Rails developers are new installation instructions for the bootstrap-sass gem. Previously, developers added Bootstrap to the Rails asset pipeline by adding to the app/assets/stylesheets/application.css.scss file:

@import "bootstrap";

Now the recommendation is to use:

@import "bootstrap-sprockets"; @import "bootstrap";

This will only matter to you if you are using glyphicons. See details if you’d like to know more.

The installation instructions are also different for the Bootstrap JavaScript components. In the file app/assets/javascripts/application.js we had:

//= require bootstrap

Now we can use:

//= require bootstrap-sprockets

The older version delivered concatenated JavaScript. The newer version uses a require for all Bootstrap modules, making output easier to debug.

Most Rails developers who are using Bootstrap are unaware of these changes, unless they’ve recently reviewed the bootstrap-sass README. It’s an example of a typical open source problem. An obscure bug gets fixed by changing how a gem gets integrated into an application but developers don’t learn they need to update their applications to accommodate the fix. That’s where the RailsApps project provides a service. I’ve updated every RailsApps example application that uses Bootstrap, so if you clone a repository or use Rails Composer to create a starter app, you’ll have the correct configuration for Bootstrap. You can use the RailsApps example applications as a reliable reference implementation, so you can easily see how Bootstrap or other gems should be integrated with Rails.