Posted by naruse on 17 Nov 2025
We are pleased to announce the release of Ruby 4.0.0-preview2. Ruby 4.0 updates its Unicode version to 15.1.0, and so on.
Language changes
*nilno longer callsnil.to_a, similar to how**nildoes not callnil.to_hash. [[Feature #21047]]
Core classes updates
Note: We’re only listing notable updates of Core class.
-
Binding
Binding#local_variablesdoes no longer include numbered parameters. Also,Binding#local_variable_getandBinding#local_variable_setreject to handle numbered parameters. [[Bug #21049]]
-
IO
IO.selectaccepts +Float::INFINITY+ as a timeout argument. [[Feature #20610]]
-
String
- Update Unicode to Version 15.1.0 and Emoji Version 15.1. [[Feature #19908]] (also applies to Regexp)
Standard Library updates
Note: We’re only listing notable updates of Standard librarires.
- ostruct 0.6.1
- pstore 0.2.0
- benchmark 0.4.0
- logger 1.7.0
- rdoc 6.13.1
- win32ole 1.9.2
- irb 1.15.2
- reline 0.6.1
- readline 0.0.4
- fiddle 1.1.6
Compatibility issues
Note: Excluding feature bug fixes.
Standard library compatibility issues
C API updates
JIT
- YJIT
- YJIT stats
ratio_in_yjitno longer works in the default build. Use--enable-yjit=statsonconfigureto enable it on--yjit-stats.- Add
invalidate_everythingto default stats, which is incremented when every code is invalidated by TracePoint.
- Add
mem_size:andcall_threshold:options toRubyVM::YJIT.enable.
- YJIT stats
- ZJIT
- Add an experimental method-based JIT compiler.
Use
--enable-zjitonconfigureto enable the--zjitsupport. - As of Ruby 4.0.0-preview2, ZJIT is not yet ready for speeding up most benchmarks. Please refrain from evaluating ZJIT just yet. Stay tuned for the Ruby 4.0 release.
- Add an experimental method-based JIT compiler.
Use
- RJIT
--rjitis removed. We will move the implementation of the third-party JIT API to the ruby/rjit repository.
Miscellaneous changes
See NEWS or commit logs for more details.
With those changes, 3607 files changed, 197451 insertions(+), 285607 deletions(-) since Ruby 3.4.0!
Download
-
https://cache.ruby-lang.org/pub/ruby/4.0/ruby-4.0.0-preview2.tar.gz
SIZE: 23444451 SHA1: 132e450bbee3f61ed0b463ed1e2bd3a3a324339c SHA256: 0a3330dae710302e11f7f0323e83219ab3c6517984691a312c662f329c5120e1 SHA512: b5e681cc84be59148485b9a2212dcf54d61cfee27431ceddb49bedc8baa913ec8b36da43242cb4f1791b25e4bfc1dcf72b5527288a0656f2933da898d0e0b40f -
https://cache.ruby-lang.org/pub/ruby/4.0/ruby-4.0.0-preview2.tar.xz
SIZE: 17554228 SHA1: f8e8b98ea85ac82610ab601a21dc9a90c5c56a97 SHA256: 0b92b15466d77a9d7e59e4a75f050d42cd50fe96c951d2b3b9f8029394cd9a43 SHA512: 7afaa8d8e832ef0ded28f1caf874da69f16105e1b3aad5947c6911364159b4c6ebd3d7ea5d7d86708e9f2f06a047921b8302ca6e75ec429a3da846845f896976 -
https://cache.ruby-lang.org/pub/ruby/4.0/ruby-4.0.0-preview2.zip
SIZE: 28933540 SHA1: 48a235cfbfd4252dce81da870c792e32309e62b9 SHA256: f5c68ee44dfcb76b61c07c437fa945814dfc516570b1c921506ac886960160ca SHA512: 508c685e46a641c74e2968daf650559503ce2bcaac3403654713adb2345c3ede2bace929294a1367afecac5edd6b2c42fa833f5313456f78c79151d310c860cf
What is Ruby
Ruby was first developed by Matz (Yukihiro Matsumoto) in 1993, and is now developed as Open Source. It runs on multiple platforms and is used all over the world especially for web development.