Ruby 2.7

2.7 released 25 December 2019, latest 2.7.8.

Ruby 2.7 reached end of life on 31 March 2023.

What changed

Ruby 2.7 added experimental pattern matching, beginless ranges, numbered block parameters, Enumerable#filter_map and Enumerable#tally, and a compacting garbage collector exposed through GC.compact. It also began the transition to Ruby 3 keyword-argument semantics: calls that rely on implicit conversion between a final positional Hash and keyword arguments can emit warnings because the old behavior is no longer the intended interface. Pattern matching was explicitly experimental, so code using it should not assume its 2.7 behavior is a stable long-term contract.

What staying costs

This cycle has reached end of life, so defects and security issues found in the Ruby runtime will not receive upstream fixes for this line. Staying on it also increases dependency risk as gems, frameworks, and native extensions move their tested and supported Ruby ranges forward. The keyword-argument transition is a particular migration risk: code that appears to work on 2.7 may produce warnings there but fail or behave differently after an upgrade if those warnings are not resolved. Experimental pattern-matching code can require source changes when moving beyond 2.7.

What to do

Choose a currently supported Ruby target and run the full application and test suite against it in CI before changing production runtimes. On Ruby 2.7, enable and treat deprecation warnings as migration work, then audit method definitions and call sites that mix positional Hash arguments, keyword arguments, double-splat operators, delegation, and forwarding. Update application dependencies, lockfiles, build images, and native extensions for the selected target, and verify all supported deployment platforms can build and load those extensions. Replace or isolate experimental pattern-matching usage where later Ruby behavior differs, test background jobs and operational scripts as well as the web application, and deploy through a staged rollback-capable release.

We can tell you what moving off Ruby 2.7 involves.

What it takes to move off Ruby 2.7 depends on what you built on it — the version you are on, how much depends on it, and how much of the work is mechanical. Leave your email with this version and we can tell you what that looks like for you.

Not sure yet? Get my plan