Search code examples
ruby-on-railsrubyrubygemsbundler

May "bundle install" update gems for rails application?


My bundle file contains gem descriptions like:

gem 'turbolinks', '~> 5'
gem 'kaminari'

During the lapse of one year, these gems were updated, losing backward compatibility. After that, if I run bundle install in a new machine that has no gems, I fear it will install all gems with the latest versions, and my code will break due to this.

Am I right? what is the solution to avoid this issue?


Solution

  • I fear it will install all gems in latest versions and my code will break due to this.

    If you've Gemfile.lock along with Gemfile bundle install doesn't break your code. The Gemfile.lock file is where Bundler records the exact versions that were installed (or must be installed). Otherwise you might have problems with versions dismiss.