2

I am using bootstrap gem in my project.

gem 'twitter-bootstrap-rails'

The bootstrap version that i have now is

/*! normalize.css v3.0.1 | MIT License | git.io/normalize */

I need to upgrade to latest bootstrap version.

It seems like the bootstrap version is not updated in the gem (https://github.com/seyhunak/twitter-bootstrap-rails/blob/master/app/assets/stylesheets/twitter-bootstrap-static/bootstrap.css.erb).

How can i upgrade the version in my application?

prajeesh
  • 2,202
  • 6
  • 34
  • 59
  • 4
    The latest version of Bootstrap is 4.0.0. It will break your layout if you don't manually adjust things because B4 is totally incompatible with B3. – WebDevBooster Jan 31 '18 at 12:33

1 Answers1

1

There are several options:

  1. You can fork twitter-bootstrap-rails gem, update BS to version 4 and edit your Gemfile:

    gem 'twitter-bootstrap-rails', git: 'link_to_your_fork'
    
  2. You can migrate to bootstrap-rubygem gem instead which uses BS4

  3. You can download latest version of BS from official site and manually put .js and .css files to ./vendor/assets/ directory. Look at these SO answers for reference: first and second

For options 2 and 3 make sure you dont use helper methods in your code which twitter-bootstrap-rails gem provides

Martin
  • 4,042
  • 2
  • 19
  • 29