From 09ac79315efee461e1a285c8874122ad444fecb8 Mon Sep 17 00:00:00 2001 From: Adam Wead Date: Tue, 7 May 2019 23:48:42 -0400 Subject: [PATCH] Install bundler Override the existing install_bundler task from the capistrano-rbenv-install gem to install the version of bundler that is used in the application. This avoids issues with incompatibilities between Ruby versions and versions of the bundler gem. --- config/deploy.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/config/deploy.rb b/config/deploy.rb index 90dfdcba6..0d0cacbd4 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -101,6 +101,17 @@ end end +namespace :rbenv do + desc 'Overrides task in capistrano-rbenv-install to install the correct version of the bundler gem' + task install_bundler: ['rbenv:map_bins'] do + on roles fetch(:rbenv_roles) do + next if test :gem, :query, "--quiet --installed --name-matches ^bundler (#{Bundler::VERSION})$" + + execute :gem, :install, :bundler, "--quiet --no-document --version #{Bundler::VERSION}" + end + end +end + namespace :deploy do desc 'Verify yaml configuration files are present and contain the correct keys' task :check_configs do