A summary of data about the Ruby ecosystem.

https://github.com/shopify/bootboot

Dualboot your Ruby app made easy
https://github.com/shopify/bootboot

Keywords

boot dependencies tooling

Keywords from Contributors

activerecord rubygems mvc activejob rubocop code-formatter static-code-analysis ruby-gem feature-flag gem

Last synced: about 3 hours ago
JSON representation

Repository metadata

Dualboot your Ruby app made easy

README.md

👢👢 Bootboot - Build Status

Introduction

Bootboot is a Bundler plugin meant to help dual boot your ruby application.

What is "Dual booting"?

In this context, dual boot is the process of booting your application with a different set of dependencies. This technique has become very popular in the Ruby community to help applications safely upgrade dependencies. If you want to learn more about it, have a look at this conference talk by @rafaelfranca.

There are two schools on how to dual boot your app, each having advantages and disadvantages.

  1. Use three Gemfiles. One with current production dependencies, a second with an alternate "next" set of dependencies, and a third containing the dependencies that both Gemfiles have in common.
# Gemfile.common
gem "some_gem"

# Gemfile
gem "rails", "~> 6.1.7.3"
eval_gemfile "Gemfile.common"

# Gemfile.next
gem "rails", "~> 7.0.4.3"
eval_gemfile "Gemfile.common"
  1. Have a single Gemfile containing dependencies separated by environment sensitive if statements.
# Gemfile

if ENV['DEPENDENCIES_NEXT']
  gem "rails", "~> 7.0.4.3"
else
  gem "rails", "~> 6.1.7.3"
end

The former doesn't require any Bundler workaround but you need to deal with three Gemfiles and the confusion that comes with it.
The latter is the approach we decided to take at Shopify and it worked very well for us for multiple years.

No matter what approach you decide to take, you'll need to create tooling to ensure that all the lockfiles are in sync whenever a developer updates a dependency.

Bootboot is only useful if you decide to follow the second approach. It creates the required tooling as well as the Bundler workaround needed to enable dual booting.

Installation

  1. In your Gemfile, add this
plugin 'bootboot', '~> 0.2.2'
  1. Run bundle install && bundle bootboot
  2. You're done. Commit the Gemfile and the Gemfile_next.lock

Note: You should only run bundle bootboot once to install the plugin, otherwise your Gemfile will get updated each time you run it.

Dual boot it!

If you want to boot using the dependencies from the Gemfile_next.lock, run any bundler command prefixed with the DEPENDENCIES_NEXT=1 ENV variable. I.e. DEPENDENCIES_NEXT=1 bundle exec irb.

Note: bootboot will use the gems and Ruby version specified per environment in your Gemfile to resolve dependencies and keep Gemfile.lock and Gemfile_next.lock in sync, but it does not do any magic to actually change the running Ruby version or install the gems in the environment you are not currently running, it simply tells Bundler which Ruby and gem versions to use in its resolution algorithm and keeps the lock files in sync. If you are a developer who is not involved in updating the dependency set, this should not affect you, simply use bundler normally. However, if you are involved in the dependency changes directly, you will often have to run DEPENDENCIES_NEXT=1 bundle install after making changes to the dependencies.

# This will update Gemfile.lock and Gemfile_next.lock and install the gems
# specified in Gemfile.lock:
$ bundle update some_gem
# This will actually install the gems specified in Gemfile_next.lock
$ DEPENDENCIES_NEXT=1 bundle install

Dual boot different Ruby versions

While dual booting is often used for framework upgrades, it is also possible to use bootboot to dual boot two Ruby versions, each with its own set of gems.

# Gemfile

if ENV['DEPENDENCIES_NEXT']
  ruby '3.2.2'
else
  ruby '3.1.4'
end

Dual booting Ruby versions does incur some additional complications however, see the examples following for more detail.

Example: updating a gem while dual booting Ruby versions

To dual boot an app while upgrading from Ruby 3.1.4 to Ruby 3.2.2, your Gemfile would look like this:

# Gemfile

if ENV['DEPENDENCIES_NEXT']
  ruby '3.2.2'
else
  ruby '3.1.4'
end

After running bundle install, Gemfile.lock will have:

RUBY VERSION
   ruby 3.1.4p206

and Gemfile_next.lock will have:

RUBY VERSION
   ruby 3.2.2p114

Assuming there's a gem some_gem with the following constraints in its gemspecs:

# some_gem-1.0.gemspec
spec.version = "1.0"
spec.required_ruby_version = '>= 3.1.4'
# some_gem-2.0.gemspec
spec.version = "2.0"
spec.required_ruby_version = '>= 3.2.2'

Running bundle update some_gem will use Ruby 3.1.4 to resolve some_gem for Gemfile.lock and Ruby 3.2.2 to resolve some_gem for Gemfile_next.lock with the following results:

Gemfile.lock:

specs:
  some_gem (1.0)

Gemfile_next.lock:

specs:
  some_gem (2.0)

Note: It is important to note that at this point, some_gem 2.0 will not be installed on your system, it will simply be specified in Gemfile_next.lock, since installing it on the system would require changing the running Ruby version. This is sufficient to keep Gemfile_next.lock in sync, but is a potential source of confusion. To install gems under both versions of Ruby, see the next section.

Vendoring both sets of gems

To vendor both sets of gems, make sure caching is enabled by checking bundle config or bundle gems using bundle pack.

bundle pack
DEPENDENCIES_NEXT=1 bundle pack

Example: running Ruby scripts while dual booting Ruby versions

When running Ruby scripts while dual booting two different Ruby versions, you have to remember to do two things simultaneously for every command:

  • Run the command with the correct version of Ruby
  • Add the DEPENDENCIES_NEXT environment variable to tell bundler to use Gemfile_next.lock

So to run a spec in both versions, the workflow would look like this (assuming chruby for version management):

$ chruby 3.1.4
$ bundle exec rspec spec/some_spec.rb
$ chruby 3.2.2
$ DEPENDENCIES_NEXT=1 bundle exec rspec spec/some_spec.rb

Perhaps more importantly, to update or install a gem, the workflow would look like this:

# This will update Gemfile.lock and Gemfile_next.lock and install the gems
# specified in Gemfile.lock:
$ chruby 3.1.4
$ bundle update some_gem
# This will actually install the gems specified in Gemfile_next.lock under the
# correct Ruby installation:
$ chruby 3.2.2
$ DEPENDENCIES_NEXT=1 bundle install

Configuration (Optional)

By default Bootboot will use the DEPENDENCIES_NEXT environment variable to update your Gemfile_next.lock. You can however configure it. For example, if you want the dualboot to happen when the SHOPIFY_NEXT env variable is present, you simply have to add this in your Gemfile:

# Gemfile
Bundler.settings.set_local('bootboot_env_prefix', 'SHOPIFY')

Keep the Gemfile_next.lock in sync

When a developer bumps or adds a dependency, Bootboot will ensure that the Gemfile_next.lock snapshot gets updated.

However, this feature is only available if you are on Bundler >= 1.17
Other versions will trigger a warning message telling them that Bootboot can't automatically keep the Gemfile_next.lock in sync.

If you use the deployment flag (bundle --deployment) this plugin won't work on Bundler <= 2.0.1. Consider using this workaround in your Gemfile for these versions of Bundler:

plugin 'bootboot', '~> 0.1.2' unless Bundler.settings[:frozen]

Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 1 day ago

Total Commits: 80
Total Committers: 21
Avg Commits per committer: 3.81
Development Distribution Score (DDS): 0.675

Commits in past year: 7
Committers in past year: 2
Avg Commits per committer in past year: 3.5
Development Distribution Score (DDS) in past year: 0.143

Name Email Commits
Edouard CHIN e****n@s****m 26
Nikita Vasilevsky n****y@s****m 12
Jacob Smith j****b@j****o 6
nekketsuuu n****u 6
dependabot[bot] 4****] 5
Jenny Shen j****n@s****m 4
David Rodríguez d****z@r****t 3
Matthew Riddle m****9@g****m 3
Gannon McGibbon g****n@g****m 2
bogdanvlviv b****v@g****m 2
Ashish Kulkarni a****h@k****v 1
Benjamin Wood b****n@h****o 1
Evan Brodie e****e 1
Jan Schill j****l@m****m 1
Nicholas La Roux l****n@g****m 1
Nick Schwaderer n****r@s****m 1
Peter Goldstein p****n@g****m 1
Yevhenii Huselietov d****6@g****m 1
code-foundations[bot] 8****] 1
eileencodes e****s@g****m 1
rrundzans r****s@g****m 1

Committer domains:


Issue and Pull Request metadata

Last synced: 2 months ago

Total issues: 21
Total pull requests: 55
Average time to close issues: 3 months
Average time to close pull requests: about 1 month
Total issue authors: 17
Total pull request authors: 20
Average comments per issue: 1.67
Average comments per pull request: 0.62
Merged pull request: 50
Bot issues: 0
Bot pull requests: 11

Past year issues: 1
Past year pull requests: 2
Past year average time to close issues: N/A
Past year average time to close pull requests: about 1 month
Past year issue authors: 1
Past year pull request authors: 1
Past year average comments per issue: 0.0
Past year average comments per pull request: 0.0
Past year merged pull request: 1
Past year bot issues: 0
Past year bot pull requests: 2

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/shopify/bootboot

Top Issue Authors

  • Edouard-chin (5)
  • MarkyMarkMcDonald (1)
  • ecbrodie (1)
  • jscharf (1)
  • maths22 (1)
  • HoneyryderChuck (1)
  • aogata-inst (1)
  • jdelStrother (1)
  • PhilCoggins (1)
  • tjchambers (1)
  • searls (1)
  • tesssie (1)
  • bf4 (1)
  • Illianthe (1)
  • gregfletch (1)

Top Pull Request Authors

  • Edouard-chin (13)
  • dependabot[bot] (10)
  • nvasilevski (8)
  • systemist (4)
  • deivid-rodriguez (2)
  • mriddle (2)
  • bogdanvlviv (2)
  • Schwad (2)
  • gmcgibbon (1)
  • janschill (1)
  • ecbrodie (1)
  • jenshenny (1)
  • cursedcoder (1)
  • eileencodes (1)
  • benjaminwood (1)

Top Issue Labels

Top Pull Request Labels

  • dependencies (10)
  • ruby (2)

Package metadata

gem.coop: bootboot

This gem remove the overhead of monkeypatching your Gemfile in order to dualboot your app using the Gemfile_next lock strategy It also ensure that dependencies in the Gemfile lock and Gemfile_next lock are in sync whenever someone updates a gem

  • Homepage: https://github.com/shopify/bootboot
  • Documentation: http://www.rubydoc.info/gems/bootboot/
  • Licenses: MIT
  • Latest release: 0.2.2 (published about 3 years ago)
  • Last Synced: 2026-03-03T16:00:42.259Z (about 8 hours ago)
  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 125,456,957 Total
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 0.069%
    • Downloads: 0.207%
  • Maintainers (1)
rubygems.org: bootboot

This gem remove the overhead of monkeypatching your Gemfile in order to dualboot your app using the Gemfile_next lock strategy It also ensure that dependencies in the Gemfile lock and Gemfile_next lock are in sync whenever someone updates a gem

  • Homepage: https://github.com/shopify/bootboot
  • Documentation: http://www.rubydoc.info/gems/bootboot/
  • Licenses: MIT
  • Latest release: 0.2.2 (published about 3 years ago)
  • Last Synced: 2026-03-01T20:01:55.871Z (2 days ago)
  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 125,301,979 Total
  • Rankings:
    • Downloads: 0.382%
    • Stargazers count: 2.859%
    • Forks count: 4.493%
    • Average: 9.001%
    • Dependent packages count: 15.693%
    • Dependent repos count: 21.579%
  • Maintainers (1)

Dependencies

Gemfile rubygems
  • rake >= 0 development
  • rubocop >= 0 development
  • rubocop-shopify >= 0
Gemfile.lock rubygems
  • ast 2.4.2
  • bootboot 0.2.1
  • minitest 5.15.0
  • parallel 1.22.1
  • parser 3.1.2.0
  • rainbow 2.2.2
  • rake 13.0.6
  • regexp_parser 2.3.0
  • rexml 3.2.5
  • rubocop 1.28.1
  • rubocop-ast 1.17.0
  • rubocop-shopify 2.5.0
  • ruby-progressbar 1.11.0
  • unicode-display_width 2.1.0
bootboot.gemspec rubygems
  • minitest ~> 5.0 development
  • rake ~> 10.0 development
.github/workflows/ci.yml actions
  • actions/checkout v3 composite
  • ruby/setup-ruby v1 composite
.github/workflows/cla.yml actions
  • Shopify/shopify-cla-action v1 composite

Score: 28.507017876473665