Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bundler to 2.5.6 #1426

Closed
wants to merge 1 commit into from
Closed

Update bundler to 2.5.6 #1426

wants to merge 1 commit into from

Conversation

schneems
Copy link
Contributor

@schneems schneems commented Feb 21, 2024

Close #1408

@@ -0,0 +1,3 @@
## Ruby apps with Bundler 2.x now receive version 2.5.6

The [Ruby Buildpack](https://devcenter.heroku.com/articles/ruby-support#libraries) now includes Bundler 2.5.6. Applications specifying Bundler 2.x in their `Gemfile.lock` will now receive this version of bundler.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving a note for anyone interested in when this is going to roll out. It is EOD for me today. I want to be around when this ships. I'll likely aim for around noon CST tomorrow. (Feb 22).

@schneems
Copy link
Contributor Author

The CI isn't publically viewable. Weird error here:

 Could not deploy 'hatchet-t-aceba7de13' (default_ruby) using 'Hatchet::GitApp' at path: './repos/rack/default_ruby'
       if this was expected add `allow_failure: true` to your deploy hash.
       Buildpack: nil
       Repo: https://git.heroku.com/hatchet-t-aceba7de13.git
       output:
       remote: Updated 5 paths from 278d00c        
       remote: Compressing source files... done.        
       remote: Building source:        
       remote: 
       remote: -----> Building on the Heroku-20 stack        
       remote: -----> Using buildpack: https://github.com/heroku/heroku-buildpack-ruby#schneems/bundler-256        
       remote: -----> Ruby app detected        
       remote: -----> Installing bundler 2.5.6        
       remote: -----> Removing BUNDLED WITH version in the Gemfile.lock        
       remote: -----> Compiling Ruby/Rack        
       remote: -----> Using Ruby version: ruby-3.1.4        
       remote: -----> Installing dependencies using bundler 2.5.6        
       remote:        Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4        
       remote:        Your Ruby version is 3.1.4, but your Gemfile specified ~> 3.0.0        
       remote:        Bundler Output: Your Ruby version is 3.1.4, but your Gemfile specified ~> 3.0.0        
       remote:         
       remote:  !        
       remote:  !     Failed to install gems via Bundler.        
       remote:  !     Detected a mismatch between your Ruby version installed and        
       remote:  !     Ruby version specified in Gemfile or Gemfile.lock. You can        
       remote:  !     correct this by running:        
       remote:  !             
       remote:  !     $ bundle update --ruby        
       remote:  !     $ git add Gemfile.lock        
       remote:  !     $ git commit -m "update ruby version"        
       remote:  !             
       remote:  !     If this does not solve the issue please see this documentation:        
       remote:  !             
       remote:  !     https://devcenter.heroku.com/articles/ruby-versions#your-ruby-version-is-x-but-your-gemfile-specified-y        
       remote:  !        
       remote:  !     Push rejected, failed to compile Ruby app.        
       remote: 
       remote:  !     Push failed        
       remote:  !        
       remote:  ! ## Warning - The same version of this code has already been built: 4f89dce50996cbceb755502192a742ccb9a51d02        
       remote:  !        
       remote:  ! We have detected that you have triggered a build from source code with version 4f89dce50996cbceb755502192a742ccb9a51d02        
       remote:  ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.        
       remote:  !        
       remote:  ! If you are developing on a branch and deploying via git you must run:        
       remote:  !        
       remote:  !     git push heroku <branchname>:main        
       remote:  !        
       remote:  ! This article goes into details on the behavior:        
       remote:  !   https://devcenter.heroku.com/articles/duplicate-build-version        
       remote: 
       remote: Verifying deploy...        
       remote: 
       remote: !	Push rejected to hatchet-t-aceba7de13.        
       remote: 
       To https://git.heroku.com/hatchet-t-aceba7de13.git
        ! [remote rejected] HEAD -> main (pre-receive hook declined)

It's because the behavior changed:

$ cat Gemfile
source "https://rubygems.org"

ruby "~> 3.0.0"

gem "rake"
⛄️ 3.1.4 🚀 /tmp/74d2406ceed790db8939548b5520a8e1
$ cat Gemfile.lock
GEM
  remote: https://rubygems.org/
  specs:
    rake (13.0.6)

PLATFORMS
  ruby
  x86_64-darwin-20

DEPENDENCIES
  rake

BUNDLED WITH
   2.3.7
$ bundle _2.5.6_ platform --ruby
No ruby version specified

Previously this would return 3.0.0 as that's what's in the Gemfile. This is a breaking change released as a minor change in 2.5.x

https://github.com/rubygems/rubygems/blob/3fbb8bb93cf54b14374825859541a522c43a8377/bundler/CHANGELOG.md#250-december-15-2023

Notably bundler 2.5.x does not support Ruby 2.6 and 2.7 which also has customers on the platform. https://devcenter.heroku.com/articles/ruby-support#unsupported-ruby-versions heroku-20 has Ruby back to 2.5.x and while it's technically an unsupported version, I'm mindful that we've never done anything to break a previously working Ruby version on a Heroku stack. So this puts me in uncharted territory.

The long term fix would be a BYO bundler policy that uses the exact version from the Gemfile.lock but that's going to require a lot of work.

In the very short term I would likely target 2.4.x as that's the feature being requested #1408.

@schneems schneems closed this Feb 21, 2024
@edmorley edmorley deleted the schneems/bundler-256 branch April 28, 2024 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Bundler 2.4.20+ to enable ruby file: '.ruby-version' in Gemfile
1 participant