@@ -90,6 +90,7 @@ def compile
9090 new_app?
9191 Dir . chdir ( build_path )
9292 remove_vendor_bundle
93+ warn_bundler_upgrade
9394 install_ruby
9495 install_jvm
9596 setup_language_pack_environment
@@ -110,6 +111,21 @@ def compile
110111
111112private
112113
114+ def warn_bundler_upgrade
115+ old_bundler_version = @metadata . read ( "bundler_version" ) . chomp if @metadata . exists? ( "bundler_version" )
116+
117+ if old_bundler_version && old_bundler_version != BUNDLER_VERSION
118+ puts ( <<-WARNING )
119+ Your app was upgraded to bundler #{ BUNDLER_VERSION } .
120+ Previously you had a successful deploy with bundler #{ old_bundler_version } .
121+
122+ If you see problems related to the bundler version please refer to:
123+ https://devcenter.heroku.com/articles/bundler-version
124+
125+ WARNING
126+ end
127+ end
128+
113129 # the base PATH environment variable to be used
114130 # @return [String] the resulting PATH
115131 def default_path
@@ -852,22 +868,10 @@ def load_bundler_cache
852868 rubygems_version_cache = "rubygems_version"
853869 stack_cache = "stack"
854870
855- old_bundler_version = @metadata . read ( bundler_version_cache ) . chomp if @metadata . exists? ( bundler_version_cache )
856871 old_rubygems_version = @metadata . read ( ruby_version_cache ) . chomp if @metadata . exists? ( ruby_version_cache )
857872 old_stack = @metadata . read ( stack_cache ) . chomp if @metadata . exists? ( stack_cache )
858873 old_stack ||= DEFAULT_LEGACY_STACK
859874
860- if old_bundler_version && old_bundler_version != BUNDLER_VERSION
861- puts ( <<-WARNING )
862- Your app was upgraded to bundler #{ BUNDLER_VERSION } .
863- Previously you had a successful deploy with bundler #{ old_bundler_version } .
864-
865- If you see problems related to the bundler version please refer to:
866- https://devcenter.heroku.com/articles/bundler-version
867-
868- WARNING
869- end
870-
871875 stack_change = old_stack != @stack
872876 convert_stack = @bundler_cache . old?
873877 @bundler_cache . convert_stack ( stack_change ) if convert_stack
0 commit comments