I tried to upgrade from Bootstrap 4 Alpha 6 to 4.0.0 final version for my Rails 5 project, I'm sure the v4.0.0 gem has been installed (I also uninstalled the alpha version gem), but when I run my project (dev mode), I found the generated Bootstrap CSS files are still based on the Alpha version.
gem 'bootstrap', '~> 4.0.0'
Other than uninstalling the old gem and install the new bootstrap gem, do I need to do anything else for the upgrade? Download the physical v4.0.0 files and replace the old files in my project?
You can have look at this article:
How to update a single gem conservatively
Option 1
This will work if all dependencies for the update are already satisfied.
Find out the version you want to update to
Change it directly in
Gemfile.lockOption 2
This will work if the gem has no shared dependencies with other gems.
'=1.2.3'bundle installbundle installonce moreOption 3
This should always work.
bundle update GEMNAMEgit diff Gemfile.lockand notice all the updates you didn't wantGemfile.lockyou don't want (manually or by staging changed lines one-by-one), leaving only the desired updates.bundle installand see if that workedOption 4
There are persistent rumors that you can update a single gem by calling
bundle update --source GEMNAME. However no one seems to know how and why this works, it's not a documented feature of Bundler. It might be an unintended side effect of something else.I believe this command will try to update GEMNAME and GEMNAME only. If this leads to unmatched dependencies to other locked gems, it will fail.
If you use this option, be sure to git diff your Gemfile.lock to see if the changes are what you expected.
Option 5
Bundler >= 1.14has a--conservative flag. Using the conservative flag allows bundle update GEM to update the version of GEM, but prevents Bundler from updating the versions of any of the gems that GEM depends on.Credits To Author: Henning Koch