Tech Racho エンジニアの「?」を「!」に。
  • Ruby / Rails関連

RubyGems 4.0.0とBundler 4.0.0がリリースされました

gemコマンドでお馴染みのRubyGems 4.0.0がリリースされました。Bundlerも4.0.0がリリースされました。

詳しくは上記情報をご覧ください。さまざまな機能追加・バグ修正・パフォーマンス強化・セキュリティ強化などが行われています。アップグレード情報もチェックしておきましょう。

今月クリスマスにはRuby 4.0.0のリリースも控えていますね。

🔗 周辺情報

  • HerokuはRubyGems 4.0.0とBundler 4.0.0に対応したそうです。

参考: Prepare release v330 by heroku-linguist[bot] · Pull Request #1671 · heroku/heroku-buildpack-ruby

  • Bundler 4.0.0の新機能として、Go言語を使ってgemを作れるようになりました。🎉

参考: Bundler v4.0.0でGo gemを作れるようにした - くりにっき

  • なお、現時点ではBundler公式サイトでは4.0.0更新は掲載されていません。

参考: Bundler: The best way to manage a Ruby application's gems

アップグレード

リリースノートにあるように、gem update --systemを実行することでRubyGems 4.0.0とBundler 4.0.0がインストールされます。

▶gem update(クリックで展開)
$ gem update --system
Fetching rubygems-update-4.0.0.gem
Successfully installed rubygems-update-4.0.0
Installing RubyGems 4.0.0
  Successfully built RubyGem
  Name: bundler
  Version: 4.0.0
  File: bundler-4.0.0.gem
Bundler 4.0.0 installed
RubyGems 4.0.0 installed
Regenerating binstubs
Regenerating plugins

## 4.0.0 / 2025-12-03

### Features:

* Undeprecate `Gem::Version.new(nil)`. Pull request
  [#9086](https://github.com/ruby/rubygems/pull/9086) by tenderlove
* Add pattern matching support to Gem::NameTuple. Pull request
  [#9064](https://github.com/ruby/rubygems/pull/9064) by baweaver
* Add pattern matching support to Gem::Platform. Pull request
  [#9062](https://github.com/ruby/rubygems/pull/9062) by baweaver

### Performance:

* Add `MAKEFLAGS=-j` by default before compiling. Pull request
  [#9131](https://github.com/ruby/rubygems/pull/9131) by Edouard-chin
* Remove some memoization. Pull request
  [#9017](https://github.com/ruby/rubygems/pull/9017) by tenderlove
* Pull `Gem.win_platform?` out of a hot path. Pull request
  [#8983](https://github.com/ruby/rubygems/pull/8983) by tenderlove
* Stop trying to remove every file on extraction. Pull request
  [#8974](https://github.com/ruby/rubygems/pull/8974) by tenderlove
* Use `IO.copy_stream` with IO object directly. Pull request
  [#8970](https://github.com/ruby/rubygems/pull/8970) by tenderlove
* Pass a file size to `IO.copy_stream`. Pull request
  [#8966](https://github.com/ruby/rubygems/pull/8966) by tenderlove
* Use File#chmod rather than FileUtils.chmod. Pull request
  [#8965](https://github.com/ruby/rubygems/pull/8965) by tenderlove

### Enhancements:

* Update all vendored libraries to latest version. Pull request
  [#9089](https://github.com/ruby/rubygems/pull/9089) by hsbt
* Removed unused `Gem::Deprecate`. Pull request
  [#9090](https://github.com/ruby/rubygems/pull/9090) by hsbt
* Add debug logging information to see the time it took to download and
  install a gem. Pull request
  [#9066](https://github.com/ruby/rubygems/pull/9066) by Edouard-chin
* Fix constants in TAR to be frozen. Pull request
  [#9041](https://github.com/ruby/rubygems/pull/9041) by tenderlove
* Remove open-ended and prerelease dependency warnings when building gems.
  Pull request [#9050](https://github.com/ruby/rubygems/pull/9050) by
  jeremyevans
* Revamp CmakeBuilder. Pull request
  [#8753](https://github.com/ruby/rubygems/pull/8753) by cfis
* Restrict what schemes are acceptable in the remote fetcher. Pull request
  [#9022](https://github.com/ruby/rubygems/pull/9022) by tenderlove
* `gem sources --prepend` and `--append` allow finer grained control of
  sources. Pull request [#8901](https://github.com/ruby/rubygems/pull/8901)
  by martinemde
* Improve `gem sources --remove` output. Pull request
  [#8909](https://github.com/ruby/rubygems/pull/8909) by deivid-rodriguez
* Make `gem sources` output more clear. Pull request
  [#8938](https://github.com/ruby/rubygems/pull/8938) by deivid-rodriguez
* Don't fail if there is no makefile, simply don't do anything. Pull
  request [#8879](https://github.com/ruby/rubygems/pull/8879) by ioquatix
* Use IMDSv2 for S3 instance credentials. Pull request
  [#7709](https://github.com/ruby/rubygems/pull/7709) by folbricht-stripe
* Fix regression in presence of RVM gems. Pull request
  [#8854](https://github.com/ruby/rubygems/pull/8854) by deivid-rodriguez
* Restore parsing "--" as an unknown platform rather than crashing. Pull
  request [#8846](https://github.com/ruby/rubygems/pull/8846) by
  deivid-rodriguez
* Installs bundler 4.0.0 as a default gem.

### Bug fixes:

* Fix test failure of mswin and nmake. Pull request
  [#9135](https://github.com/ruby/rubygems/pull/9135) by hsbt
* Respect `BUNDLE_VERSION` config at Gem::BundlerVersionFinder. Pull
  request [#9106](https://github.com/ruby/rubygems/pull/9106) by hsbt
* Fix "did you mean" suggestions for unknown commands. Pull request
  [#8948](https://github.com/ruby/rubygems/pull/8948) by deivid-rodriguez
* Fix trailing slashes not considered by `gem sources --remove`. Pull
  request [#8939](https://github.com/ruby/rubygems/pull/8939) by
  deivid-rodriguez

### Security:

* Bump up vendored URI to 1.0.4. Pull request
  [#9031](https://github.com/ruby/rubygems/pull/9031) by hsbt

### Breaking changes:

* Removed deprecated `-C` option from gem build. Pull request
  [#9088](https://github.com/ruby/rubygems/pull/9088) by hsbt
* Removed deprecated Gem::Specification#has_rdoc, has_rdoc= and has_rdoc?.
  Pull request [#9084](https://github.com/ruby/rubygems/pull/9084) by hsbt
* Removed deprecated `gem query` command. Pull request
  [#9083](https://github.com/ruby/rubygems/pull/9083) by hsbt
* Removed deprecated Gem::DependencyInstaller#find_gems_with_sources. Pull
  request [#9082](https://github.com/ruby/rubygems/pull/9082) by hsbt
* Remove deprecated methods of RubyGems. Pull request
  [#9081](https://github.com/ruby/rubygems/pull/9081) by hsbt
* Make verification methods private. Pull request
  [#9051](https://github.com/ruby/rubygems/pull/9051) by tenderlove
* Deprecate `--default` option from install command. Pull request
  [#7588](https://github.com/ruby/rubygems/pull/7588) by hsbt
* Removed `compatibility.rb` for RG 4.0. Pull request
  [#8899](https://github.com/ruby/rubygems/pull/8899) by hsbt

### Deprecations:

* Deprecate `Gem::Specification#datadir`. Pull request
  [#8900](https://github.com/ruby/rubygems/pull/8900) by hsbt

### Documentation:

* Unified UPGRADING.md and extract blog.rubygems.org. Pull request
  [#9148](https://github.com/ruby/rubygems/pull/9148) by hsbt
* Remove italic formatting from changelog section headers. Pull request
  [#9128](https://github.com/ruby/rubygems/pull/9128) by hsbt
* [DOC] Fix the location of Gem::Deprecate document. Pull request
  [#9065](https://github.com/ruby/rubygems/pull/9065) by nobu
* Fix typo. Pull request
  [#9012](https://github.com/ruby/rubygems/pull/9012) by etiennebarrie
* Added document for Gem::Uninstaller. Pull request
  [#8904](https://github.com/ruby/rubygems/pull/8904) by hsbt
* Use mailto link in Code of Conduct. Pull request
  [#8849](https://github.com/ruby/rubygems/pull/8849) by deivid-rodriguez
* Update Code of Conduct email to conduct@rubygems.org. Pull request
  [#8848](https://github.com/ruby/rubygems/pull/8848) by indirect

## 3.7.2 / 2025-09-09

### Enhancements:

* `gem sources --prepend` and `--append` allow finer grained control of
  sources. Pull request
  [#8901](https://github.com/ruby/rubygems/pull/8901) by martinemde
* Improve `gem sources --remove` output. Pull request
  [#8909](https://github.com/ruby/rubygems/pull/8909) by
  deivid-rodriguez
* Make `gem sources` output more clear. Pull request
  [#8938](https://github.com/ruby/rubygems/pull/8938) by
  deivid-rodriguez
* Use IMDSv2 for S3 instance credentials. Pull request
  [#7709](https://github.com/ruby/rubygems/pull/7709) by
  folbricht-stripe
* Installs bundler 2.7.2 as a default gem.

### Bug fixes:

* Fix "did you mean" suggestions for unknown commands. Pull request
  [#8948](https://github.com/ruby/rubygems/pull/8948) by
  deivid-rodriguez
* Fix trailing slashes not considered by `gem sources --remove`. Pull
  request [#8939](https://github.com/ruby/rubygems/pull/8939) by
  deivid-rodriguez

## 3.7.1 / 2025-07-21

### Enhancements:

* Fix regression in presence of RVM gems. Pull request
  [#8854](https://github.com/ruby/rubygems/pull/8854) by
  deivid-rodriguez
* Restore parsing "--" as an unknown platform rather than crashing. Pull
  request [#8846](https://github.com/ruby/rubygems/pull/8846) by
  deivid-rodriguez
* Installs bundler 2.7.1 as a default gem.

### Documentation:

* Use mailto link in Code of Conduct. Pull request
  [#8849](https://github.com/ruby/rubygems/pull/8849) by
  deivid-rodriguez
* Update Code of Conduct email to conduct@rubygems.org. Pull request
  [#8848](https://github.com/ruby/rubygems/pull/8848) by indirect

## 3.7.0 / 2025-07-16

### Security:

* Update vendored resolv to 0.6.2. Pull request
  [#8831](https://github.com/ruby/rubygems/pull/8831) by hsbt

### Breaking changes:

* Stop generating binstubs with support for RubyGems before 2.6.2. Pull
  request [#8833](https://github.com/ruby/rubygems/pull/8833) by
  deivid-rodriguez
* Drop support for Ruby 3.1. Pull request
  [#8634](https://github.com/ruby/rubygems/pull/8634) by segiddins

### Enhancements:

* Update SPDX license list as of 2025-07-01. Pull request
  [#8829](https://github.com/ruby/rubygems/pull/8829) by
  github-actions[bot]
* Add `push_rubygem` as a default scope for `gem signin` command. Pull
  request [#8672](https://github.com/ruby/rubygems/pull/8672) by hsbt
* Update bundled tls certs. Pull request
  [#8731](https://github.com/ruby/rubygems/pull/8731) by segiddins
* Install the best matching gem for the current platform in `gem install`.
  Pull request [#8751](https://github.com/ruby/rubygems/pull/8751) by
  segiddins
* Move most of `Bundler::GemHelpers` to `Gem::Platform`. Pull request
  [#8703](https://github.com/ruby/rubygems/pull/8703) by segiddins
* Ensure that `Gem::Platform` parses strings to a fix point. Pull request
  [#8584](https://github.com/ruby/rubygems/pull/8584) by segiddins
* Installs bundler 2.7.0 as a default gem.

### Bug fixes:

* Fix signing HEAD and date formatting in S3 signer. Pull request
  [#8763](https://github.com/ruby/rubygems/pull/8763) by rye-stripe
* Fix `--bindir <foo>` flag to gem install failing when `<foo>` is not in
  the default GEM_HOME and its parent directory does not exist yet. Pull
  request [#8783](https://github.com/ruby/rubygems/pull/8783) by larouxn
* Fix `gem install` sometimes compiling the wrong source files. Pull
  request [#8764](https://github.com/ruby/rubygems/pull/8764) by
  deivid-rodriguez
* Workaround rust extension compilation when `ccache` or `sccache` are
  used. Pull request [#8521](https://github.com/ruby/rubygems/pull/8521)
  by hsbt
* Fix `gem pristine` not recompiling extensions sometimes. Pull request
  [#8757](https://github.com/ruby/rubygems/pull/8757) by
  deivid-rodriguez
* Fix `--prerelease` flag to `gem install` sometimes not respected. Pull
  request [#8648](https://github.com/ruby/rubygems/pull/8648) by ntl

### Documentation:

* Fix incorrect UPGRADING link in README.md. Pull request
  [#8838](https://github.com/ruby/rubygems/pull/8838) by djbender
* Add a root CONTRIBUTING.md file. Pull request
  [#8822](https://github.com/ruby/rubygems/pull/8822) by
  deivid-rodriguez
* Add a SECURITY.md file. Pull request
  [#8812](https://github.com/ruby/rubygems/pull/8812) by
  deivid-rodriguez
* Fix heading ranks in documentation. Pull request
  [#8711](https://github.com/ruby/rubygems/pull/8711) by antoinem


------------------------------------------------------------------------------

RubyGems installed the following executables:
    /Users/hachi8833/.anyenv/envs/rbenv/versions/3.4.7/bin/gem
    /Users/hachi8833/.anyenv/envs/rbenv/versions/3.4.7/bin/bundle
    /Users/hachi8833/.anyenv/envs/rbenv/versions/3.4.7/bin/bundler

RubyGems system software updated

$ gem --version
4.0.0
$ bundler --version
4.0.0

関連記事

Ruby 3.3.10がリリースされました

Ruby 3.3.9と3.2.9がリリースされました(セキュリティ修正バックポート含む)


CONTACT

TechRachoでは、パートナーシップをご検討いただける方からの
ご連絡をお待ちしております。ぜひお気軽にご意見・ご相談ください。