This seems to be the right way that bootstrap icons should be added to Ruby on Rails, I have tried many other ways, some work in local and fail in production, others work in normal production boxes but fail in Heroku, this one seems to work every where.

First you need to add bootstrap-icons to your project using yarn like this:

$ yarn add bootstrap-icons

Next at the end of app/assets/stylesheets/application.scss add this code:

@import "bootstrap-icons/font/bootstrap-icons";
@font-face {
  font-family: "bootstrap-icons";
  src: font-url("bootstrap-icons/font/fonts/bootstrap-icons.woff2") format("woff2"),
    font-url("bootstrap-icons/font/fonts/bootstrap-icons.woff") format("woff");
}

You can start using bootstrap icons like this now:

This is the icon for pencil <i class="bi bi-pencil"></i>.

Yo could write a helper, in app/helpers/bootstrap_icon_helper.rb add htis:

module BootstrapIconHelper
  def icon(name)
    %Q{
      <i class="bi bi-#{name}"></i>
    }
  end
end

Now in your application views, you can use icon like this:

This is the icon for pencil <%= icon 'pencil' %>.

If you are working under a psycho boss who says there must be brackets for Ruby method calls, you can code like this:

This is the icon for pencil <%= icon('pencil') %>.