Skip to content

Commit b43aab5

Browse files
authored
Update default Ruby version to 3.3.7 (heroku#1534)
* Update default Ruby version to 3.3.6 The latest Ruby is now 3.4.x. Our ideal default policy is to use the latest release of the prior year's version. This PR updates to the latest Ruby 3.3.x version which is 3.3.6. * Update to non-deprecated method * Ruby 3.3.7 is now the default * Update test apps * s/exists?/exist?/ Fixes: ``` -----> Building on the Heroku-24 stack -----> Fetching https://github.com/heroku/heroku-buildpack-ruby#schneems/default-ruby-336 buildpack... buildpack downloaded -----> Ruby app detected ! ! undefined method `exists?' for class Dir ! /tmp/buildpacks/55030ecaa578151bf5924184e8750b99212faef5/lib/language_pack/helpers/bundler_wrapper.rb:242:in `fetch_bundler': undefined method `exists?' for class Dir (NoMethodError) return true if Dir.exists?(bundler_path) ^^^^^^^^ Did you mean? exist? ``` * Update tests * Bundler default version now 2.3.x Bundler 1.x is not able to run with Ruby 3.3 in some circumstances: ``` remote: ! There was an error parsing your Gemfile, we cannot continue remote: ! /tmp/d20250127-138-l8vq2r/bundler-1.17.3/gems/bundler-1.17.3/lib/bundler/shared_helpers.rb:29:in `root': undefined method `untaint' for an instance of Pathname (NoMethodError) remote: ! remote: ! Pathname.new(gemfile).untaint.expand_path.parent ``` This commit updates the default bundler version to 2.3.x. * Update older rails versions in tests * Update example to default bundler version * Update fixtures * Update fixtures * Remove unused test * Remove test This asserts that we ignore invalid or incorrect patch numbers i.e. p0 in the gem file.lock is not correct: ``` RUBY VERSION ruby 2.5.1p0 ``` We don't really need to keep and maintain this fixture. * Fix an error * Fix spec * Remove bundler 1.x spec This no longer builds on the platform: ``` remote: ! There was an error parsing your Gemfile, we cannot continue remote: ! /tmp/d20250204-129-9ld2nw/bundler-1.17.3/gems/bundler-1.17.3/lib/bundler/shared_helpers.rb:29:in `root': undefined method `untaint' for an instance of Pathname (NoMethodError) remote: ! remote: ! Pathname.new(gemfile).untaint.expand_path.parent remote: ! ^^^^^^^^ remote: ! from /tmp/d20250204-129-9ld2nw/bundler-1.17.3/gems/bundler-1.17.3/lib/bundler.rb:234:in `root' remote: ! from /tmp/d20250204-129-9ld2nw/bundler-1.17.3/gems/bundler-1.17.3/lib/bundler.rb:246:in `app_config_path' ``` * Fix fetcher spec and test all bundler versions * Update fixture * CI apps that use the database need one * Fix test * Fix tests * Change command so it works on bsdtar (hopefully gnutar tar too, but we will find out one way or another). * Update tests * Update fixtures * Fix missing repo * Update tests * Update test * Update fixture * Fix test * Fix test * Update fixture * Update fixtures * Remove-un-needed version write * Allow heredoc to use interpolation * Update fixtures * Fix ruby version * Update test * Update fixture * Update fixtures * Adjust test addon * Fix Rails 7 sql/schema test In Rails 7 the tasks converged into one
1 parent b3ccc41 commit b43aab5

34 files changed

Lines changed: 165 additions & 197 deletions

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## [Unreleased]
44

5+
- Default Ruby version is now 3.3.7 (https://github.com/heroku/heroku-buildpack-ruby/pull/1534)
6+
- Default bundler version (when no version present in the `Gemfile.lock`) is now bundler `2.3.x` which is currently `2.3.25` (https://github.com/heroku/heroku-buildpack-ruby/pull/1534)
57

68
## [v293] - 2025-02-15
79

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
source "https://rubygems.org"
22
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
33

4-
ruby '>= 3.1', '< 3.3'
4+
ruby "3.3.7"
55

66
group :development, :test do
77
gem "toml-rb"

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ DEPENDENCIES
7373
toml-rb
7474

7575
RUBY VERSION
76-
ruby 3.1.6p260
76+
ruby 3.3.7p260
7777

7878
BUNDLED WITH
7979
2.5.11

buildpack.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[buildpack]
22
name = "Ruby"
3-
ruby_version = "3.1.6"
3+
ruby_version = "3.3.7"
44

55
[publish.Ignore]
66
files = [
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## Ruby applications with no specified bundler versions now receive Bundler 2.x
2+
3+
Previously applications with no `BUNDLED WITH` in their `Gemfile.lock` would receive bundler `1.x`. They will now receive the new [default bundler version](https://devcenter.heroku.com/articles/ruby-support-reference#default-bundler-version) `2.3.x`.
4+
5+
It is strongly recommended that you have both a `RUBY VERSION` and `BUNDLED WITH` version listed in your `Gemfile.lock`. If you do not have those values, you can generate them and commit them to git:
6+
7+
```
8+
$ bundle update --ruby
9+
$ git add Gemfile.lock
10+
$ git commit -m "Update Gemfile.lock"
11+
```
12+
13+
Applications without these values specified in the `Gemfile.lock` may break unexpectedly when the defaults change.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Default Ruby version for new apps is now 3.3.7
2+
3+
The [default Ruby version for new Ruby applications is 3.3.7](https://devcenter.heroku.com/articles/ruby-support#default-ruby-version-for-new-apps). You’ll only get the default if the application does not specify a ruby version.

hatchet.json

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,31 @@
44
"sharpstone/asset_precompile_pass",
55
"sharpstone/asset_precompile_not_found",
66
"sharpstone/no_rakefile",
7-
"sharpstone/bad_rakefile",
8-
"sharpstone/default_with_rakefile"
7+
"sharpstone/bad_rakefile"
98
],
109
"bundler": [
11-
"sharpstone/problem_gemfile_version",
1210
"sharpstone/git_gemspec",
1311
"sharpstone/no_lockfile",
14-
"sharpstone/sqlite3_gemfile",
15-
"sharpstone/nokogiri_160"
12+
"sharpstone/sqlite3_gemfile"
1613
],
1714
"ruby": [
1815
"sharpstone/ruby_version_does_not_exist",
19-
"sharpstone/ruby_193_jruby_17161_jdk7",
20-
"sharpstone/ruby_25",
2116
"sharpstone/jruby-minimal",
2217
"sharpstone/empty-procfile",
23-
"sharpstone/bad_ruby_version",
24-
"sharpstone/activerecord41_scaffold",
25-
"sharpstone/libpq_connection_error"
26-
],
27-
"jruby": [
28-
"sharpstone/jruby_naether"
18+
"sharpstone/bad_ruby_version"
2919
],
3020
"rack": [
31-
"sharpstone/default_ruby",
32-
"sharpstone/mri_187_nokogiri",
33-
"sharpstone/mri_192"
21+
"sharpstone/default_ruby"
3422
],
3523
"rails_versions": [
3624
"sharpstone/rails_lts_23_default_ruby",
3725
"sharpstone/rails3_default_ruby",
3826
"sharpstone/rails4_windows_mri193",
3927
"sharpstone/rails42_default_ruby",
40-
"sharpstone/active_storage_non_local",
41-
"sharpstone/active_storage_local",
42-
"sharpstone/sprockets_asset_compile_true",
4328
"sharpstone/rails61",
44-
"sharpstone/rails-jsbundling"
29+
"sharpstone/rails-jsbundling",
30+
"sharpstone/rails_8_ruby_schema",
31+
"sharpstone/rails_8_sql_schema"
4532
],
4633
"heroku": [
4734
"heroku/ruby-getting-started"
@@ -50,10 +37,7 @@
5037
"sharpstone/minimal_webpacker"
5138
],
5239
"ci": [
53-
"sharpstone/rails5_ruby_schema_format",
5440
"sharpstone/heroku-ci-json-example",
55-
"sharpstone/rails5_sql_schema_format",
56-
"sharpstone/ruby_no_rails_test",
57-
"sharpstone/activerecord_rake_tasks_does_not_exist"
41+
"sharpstone/ruby_no_rails_test"
5842
]
5943
}

hatchet.lock

Lines changed: 12 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,52 +3,34 @@
33
- 7755e19caf122e1373bce73ffe9b333e9411d732
44
- - "./repos/bundler/no_lockfile"
55
- 1947ce9a9c276d5df1c323b2ad78d1d85c7ab4c0
6-
- - "./repos/bundler/nokogiri_160"
7-
- d9a761776be43e1c685f98ef13c6ef1ee0292267
8-
- - "./repos/bundler/problem_gemfile_version"
9-
- abc25a7b582a720b99148a1c8753d0d7452254bb
106
- - "./repos/bundler/sqlite3_gemfile"
117
- 116db685f54dae18f703b3beb90e64fdbddb048d
12-
- - "./repos/ci/activerecord_rake_tasks_does_not_exist"
13-
- a6b711be6921cf7a0aa4e31269c37965799ea110
148
- - "./repos/ci/heroku-ci-json-example"
15-
- 4e5410a7381f486ba3df7739e02e52f32fdd4dda
16-
- - "./repos/ci/rails5_ruby_schema_format"
17-
- 8b8a3a7850bdba29bdefc70c0f80f35a9e6c96ae
18-
- - "./repos/ci/rails5_sql_schema_format"
19-
- ee81b300a1019b47bbcaec0a512932df7dc23bc0
9+
- 728cc99c8e80290cc07441d61a8bcd4596e696fb
2010
- - "./repos/ci/ruby_no_rails_test"
21-
- 3916137106d59b008b67d738abe6a1438f8fbde6
11+
- c5925ab061f65433ec5dcbc890975f580e74c5ce
2212
- - "./repos/heroku/ruby-getting-started"
2313
- main
24-
- - "./repos/jruby/jruby_naether"
25-
- 4a11f8af5a3cca21f3659394e5bbac3cca9b6a2c
2614
- - "./repos/node/minimal_webpacker"
27-
- 9152fec98df59a0bf8a5478ed428841ee135acbb
15+
- d659577a612b12ddb44ce34e28124c025ecb22f3
2816
- - "./repos/rack/default_ruby"
2917
- master
30-
- - "./repos/rack/mri_187_nokogiri"
31-
- 3fcce9c85bf560dba285cc385ae9845729195826
32-
- - "./repos/rack/mri_192"
33-
- ef6b5ccf8aa2a8f5e3745934e3580dc0bd2d6d4b
34-
- - "./repos/rails_versions/active_storage_local"
35-
- 18853ba7dda61745995740b4ca6f5f90bbd8afba
36-
- - "./repos/rails_versions/active_storage_non_local"
37-
- 86dddf0127043abba1cb2890590a1d38f111edbd
3818
- - "./repos/rails_versions/rails-jsbundling"
39-
- c58178e061d9846386ca34ea31c99f6e6bb8dbf7
19+
- 50e9fdf7c3a37623c676989ddebac4ee5349734b
4020
- - "./repos/rails_versions/rails3_default_ruby"
41-
- a6b44db674c0d3538633989295e2cfd5e8e1ba0d
21+
- 984b6d02353519251c2d1e885bf8914a2584f26a
4222
- - "./repos/rails_versions/rails42_default_ruby"
43-
- dfa0f0133dafa62064968ea2efb6432f54350138
23+
- fbdaf031823f09d1514ec1d55dcb04ca2f4264ca
4424
- - "./repos/rails_versions/rails4_windows_mri193"
4525
- f4c7b6209835050468bbb87827acf652b8f4d8ce
4626
- - "./repos/rails_versions/rails61"
47-
- e896f51e679eaf2204aa4fab6d038103fc622aed
27+
- 47828a3e8c79b7869ca0d9a3afa4be065fa46e96
28+
- - "./repos/rails_versions/rails_8_ruby_schema"
29+
- a993a3f00c8e09f733bc3b783f7e37148d0af1d4
30+
- - "./repos/rails_versions/rails_8_sql_schema"
31+
- d5089812196931e858a97119de1640a86825a272
4832
- - "./repos/rails_versions/rails_lts_23_default_ruby"
49-
- 7178b2f97d3b2b3170b390d997dcb212dd52cd30
50-
- - "./repos/rails_versions/sprockets_asset_compile_true"
51-
- 6f3aa208046a5c79e84fc272f52f5ebb7b775755
33+
- f3597fd6f0887763eb65ec2f83a5e9a5155d5625
5234
- - "./repos/rake/asset_precompile_fail"
5335
- 16f7834331d6bb3fc5c284130b14eb1ff74d99d5
5436
- - "./repos/rake/asset_precompile_not_found"
@@ -57,23 +39,13 @@
5739
- ce976c727d9f477957c499f39f4cf9603c378103
5840
- - "./repos/rake/bad_rakefile"
5941
- 3cb9c7bf6494c59bd25fa74c2aa4531119e12a46
60-
- - "./repos/rake/default_with_rakefile"
61-
- c6e0c4db8dcccb47e11d496e17adbc2dafc80dd8
6242
- - "./repos/rake/no_rakefile"
6343
- d2ec2084b825218418dac54bd6276ac896b31cdd
64-
- - "./repos/ruby/activerecord41_scaffold"
65-
- 6e4662c44b49e2c3c9429f00e7e7f4708142b03f
6644
- - "./repos/ruby/bad_ruby_version"
6745
- 7bf3470265a87ea6361640aa4bfce6ce3b743520
6846
- - "./repos/ruby/empty-procfile"
6947
- 7cae0aae424c2028b81b5d37ee24d42db8e545b9
7048
- - "./repos/ruby/jruby-minimal"
7149
- f79860bc2866449fe065484f1542aaadd3f7cfd2
72-
- - "./repos/ruby/libpq_connection_error"
73-
- c211c245f09d8335a520cd7a0b5360897d4988eb
74-
- - "./repos/ruby/ruby_193_jruby_17161_jdk7"
75-
- c1b632f8a96cf9b902f5cdcd7a190d46544a8144
76-
- - "./repos/ruby/ruby_25"
77-
- 0cb3df80d55b61e9417f2ac00adb06e15ae37982
7850
- - "./repos/ruby/ruby_version_does_not_exist"
7951
- 9b6ad8e3b4fa7850393a5f232bb40ff3cd414d8b

lib/language_pack/base.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def build_release
112112

113113
def write_release_yaml
114114
release = build_release
115-
FileUtils.mkdir("tmp") unless File.exists?("tmp")
115+
FileUtils.mkdir("tmp") unless File.exist?("tmp")
116116
File.open("tmp/heroku-buildpack-release-step.yml", 'w') do |f|
117117
f.write(release.to_yaml)
118118
end

lib/language_pack/cache.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,6 @@ def cache_copy(from,to)
8787
def exists?(path)
8888
return unless @cache_base
8989

90-
File.exists?(@cache_base + path)
90+
File.exist?(@cache_base + path)
9191
end
9292
end

0 commit comments

Comments
 (0)