Ruby & Sinatra Compatibility Table

Ruby & Sinatra Compatibility Table

Sinatra opens a new window is known in the Ruby world for being a lightweight framework for building Ruby web applications with minimal effort.

Over time Sinatra has been through many versions, and sometimes it gets complicated keeping track of which versions of Sinatra are compatible with which versions of Ruby. Therefore, we made a handy chart!

If you find yourself or your company struggling on an upgrade for either Sinatra or Ruby let us know, our company specializes in upgrades! We have all different packages, for all different size companies opens a new window .

Sinatra Version opens a new window Minimum Ruby opens a new window Rack opens a new window Recommended Ruby Sinatra Status opens a new window
4.2.x >= 2.7.8 Rack 3.x 3.4.Z Current
4.1.x >= 2.7.8 Rack 3.x 3.3.Z Security backports
4.0.x >= 2.7.8 Rack 3.x 3.3.Z Security backports
3.2.0 >= 2.6.0 Rack 2.x 3.3.Z End of life
3.1.0 >= 2.6.0 Rack 2.x 3.2.Z End of life
3.0.x >= 2.6.0 Rack 2.x 3.1.Z End of life
2.2.x >= 2.3.0 Rack 2.x 3.0.Z End of life
2.1.0 >= 2.3.0 Rack 2.x 2.7.1 End of life
2.0.x >= 2.2.0 Rack 2.x 2.4.1 End of life
1.4.x >= 1.8.7 Rack 1.x 2.4.0 End of life


To find more information about the most recent Ruby releases check out this page: Ruby Releases opens a new window

How to read this table

The columns mean different things, so it helps to be precise:

  • Minimum Ruby is the lowest Ruby version each release accepts, taken from the required_ruby_version declared in that release’s gemspec opens a new window . It is a floor, not a full compatibility matrix. A release will usually run on any newer Ruby up to whatever its CI actually exercises.
  • Rack is the major Rack line each Sinatra release depends on. This matters as much as the Ruby version: Sinatra 4.x requires Rack 3 (rack >= 3.0, < 4), while Sinatra 2.x and 3.x are pinned to Rack 2 (rack ~> 2.0 for 2.0.x, rack ~> 2.2 from 2.1 through 3.2). Sinatra 1.4.x uses Rack 1 (rack ~> 1.5). If a dependency in your app pins Rack 2, you cannot move to Sinatra 4 until that is resolved. See the Rack 3 support thread opens a new window for the history.
  • Recommended Ruby is the newest stable Ruby that release tests against in Sinatra’s CI matrix opens a new window . This is the version we would target if we were running that Sinatra release today. Note that for older Sinatra lines the recommended Ruby is itself end of life, which is a signal to upgrade Sinatra, not just Ruby.
  • Sinatra Status reflects the Sinatra maintenance policy opens a new window as of the “Updated on” date at the top of this post. 4.2.x is the current line, the rest of the 4.x line receives security backports, and everything 3.x and older is effectively end of life now that Rack 3 support has landed in 4.x.

A note on patch versions

We collapse rows like 4.2.x, 3.0.x, and 2.0.x because every patch release inside a Sinatra minor series shares the same required_ruby_version and Rack constraint. For example, both 4.2.0 opens a new window and 4.2.1 opens a new window declare >= 2.7.8 and rack >= 3.0, < 4. If you ever hit a patch release that differs, the gemspec linked above is the source of truth, and we would love to hear about it.

Ruby support status

The recommended Ruby for older Sinatra releases points at Ruby versions that are no longer maintained. As of this post’s update date, Ruby 3.3 and 3.4 are in normal maintenance, while Ruby 3.2 and everything older has reached end of life. Always check the current Ruby maintenance branches opens a new window and the Ruby releases opens a new window page before you commit to a target.

JRuby and TruffleRuby

This table covers CRuby (MRI), which is what Sinatra’s gemspec and CI matrix are written against. Sinatra runs on JRuby and TruffleRuby too, but the constraint shifts: pick a JRuby or TruffleRuby release that is compatible with the Ruby language level in the Minimum Ruby column. For example, a Sinatra 4.x app needs a JRuby release that targets Ruby 2.7 or newer (JRuby 9.4+ targets Ruby 3.x). When you run on an alternative runtime, treat the Minimum Ruby column as the language level to match and check your runtime’s own compatibility notes.

Suggested upgrade path

If you are several versions behind, upgrade in small, releasable steps rather than jumping straight to the top:

  1. Get current on your existing Sinatra major first (for example, move from 2.0.x to the latest 2.2.x), then bump Ruby to the newest version that line supports.
  2. Move from Sinatra 2.2.x to 3.2.0. This stays on Rack 2, so the blast radius is smaller. Bump Ruby toward 3.3 along the way.
  3. Move from Sinatra 3.2.0 to 4.x. This is the big one because it pulls in Rack 3, which has its own breaking changes (header names are lowercased, the response body must respond to each, and several middleware were moved or renamed). Audit your Rack middleware and any gems that pin Rack 2 before this step.

The Rack 2 to Rack 3 jump is not a separate step you can do on its own: Sinatra 3.2 requires Rack 2, and Sinatra 4 requires Rack 3, so the Rack major moves at the same moment as the Sinatra 3.2 to 4.x bump. The reason to get current on Ruby and Sinatra in steps 1 and 2 first is so that this final step carries only the Sinatra and Rack majors, instead of mixing in a Ruby bump too.

Feedback Wanted: Updates

This table goes back to Sinatra 1.4.x. The 1.4.x gemspec did not declare a required_ruby_version, so the >= 1.8.7 floor comes from Sinatra’s documentation of that era rather than the gemspec. For releases before 1.4.x we were not able to find reliable per-release Ruby information, so let us know if you find incompatibilities for earlier versions.

Feel free to get in contact with us through social media on Mastodon opens a new window .

We will continue to update this article as new versions of Sinatra are released.

Get the book