---
title: "sinatra 4.0.0 Breaking Changes on RubyGems | Since.dev"
description: "What each sinatra release removed, renamed or changed: 21 breaking changes in 3 versions on RubyGems, each with its source."
canonical_url: https://since.dev/packages/gem/sinatra
last_updated: 2026-12-04
---

# sinatra breaking changes

sinatra 4.0.0 (January 19, 2024) is its newest release with breaking changes, 6 of them. The first: Drops support for Rack 2 in sinatra 4.0.0. Every breaking API change we have recorded in sinatra on RubyGems: 21 breaking changes in 3 versions. Below, its 3 versions with breaking changes, newest first, removals and renames first, each with its source.

Updated December 4, 2026

Latest version `4.2.2`. [Source repository](https://github.com/sinatra/sinatra)

Its 4.0.0 release requires Ruby 2.7.8 or later. [Ruby end of life dates](https://since.dev/calendar/ruby.md).

- From [3.0.0](#v-3-0-0) to [4.0.0](#v-4-0-0): 6 breaking changes in 1 version.
- From [2.0.0](#v-2-0-0) to [4.0.0](#v-4-0-0): 12 breaking changes in 2 versions.

## sinatra 4.0.0 breaking changes

sinatra 4.0.0, released January 19, 2024: 6 breaking changes.

- **Removed**  

This release supports only Rack 3, so apps still on Rack 2 must upgrade before using it. [github.com](https://github.com/sinatra/sinatra/blob/v4.0.0/CHANGELOG.md)
- **Removed**  

Sinatra 4.0.0 requires Ruby 2.7.8 or later, so older Ruby versions can no longer be used. [github.com](https://github.com/sinatra/sinatra/blob/v4.0.0/CHANGELOG.md)
- **Removed** `IndifferentHash`  

The IndifferentHash initializer is gone, so code that calls it will no longer work. [github.com](https://github.com/sinatra/sinatra/blob/v4.0.0/CHANGELOG.md)
- **Removed** `Rack.Protection.EncryptedCookie`  

Rack::Protection::EncryptedCookie is removed; cookies remain encrypted through Rack::Session::Cookie. [github.com](https://github.com/sinatra/sinatra/blob/v4.0.0/CHANGELOG.md)
- **Default changed** `session_hijacking`  

The session_hijacking protection is now disabled by default; enable it explicitly if you need it. [github.com](https://github.com/sinatra/sinatra/blob/v4.0.0/CHANGELOG.md)
- **Configuration changed**  

To start the web server through Sinatra you must now install the rackup gem. [github.com](https://github.com/sinatra/sinatra/blob/v4.0.0/CHANGELOG.md)

## sinatra 3.0.0 breaking changes

sinatra 3.0.0, released September 26, 2022: 6 breaking changes.

- **Removed**  

Ruby versions older than 2.6 are no longer supported. Upgrade Ruby before updating Sinatra. [github.com](https://github.com/sinatra/sinatra/blob/v3.0.0/CHANGELOG.md)
- **Removed** `erubis template engine`  

Support for the erubis template engine is removed. Templates using it must be moved to a supported engine. [github.com](https://github.com/sinatra/sinatra/blob/v3.0.0/CHANGELOG.md)
- **Removed** `Reel integration`  

The Reel integration is removed. Code relying on it must be changed. [github.com](https://github.com/sinatra/sinatra/blob/v3.0.0/CHANGELOG.md)
- **Removed** `Stylus template engine`  

Support for the Stylus template engine is removed. Templates using it must be moved to a supported engine. [github.com](https://github.com/sinatra/sinatra/blob/v3.0.0/CHANGELOG.md)
- **Removed** `textile template engine`  

Support for the textile template engine is removed. Templates using it must be moved to a supported engine. [github.com](https://github.com/sinatra/sinatra/blob/v3.0.0/CHANGELOG.md)
- **Behavior changed** `Sinatra.Error`  

Internal Sinatra errors now inherit from Sinatra::Error, so rescue clauses for Sinatra::Error will catch them. [github.com](https://github.com/sinatra/sinatra/blob/v3.0.0/CHANGELOG.md)

## sinatra 2.0.0 breaking changes

sinatra 2.0.0, released May 7, 2017: 9 breaking changes.

- **Behavior changed**  

The authenticity token length is now a fixed value of 32. [github.com](https://github.com/sinatra/sinatra/blob/v2.0.0/CHANGELOG.md)
- **Behavior changed**  

Rack middleware is now initialized when the server starts rather than when the first request arrives. [github.com](https://github.com/sinatra/sinatra/blob/v2.0.0/CHANGELOG.md)
- **Behavior changed**  

Route patterns are now parsed by Mustermann, which may change how existing route patterns match. [github.com](https://github.com/sinatra/sinatra/blob/v2.0.0/CHANGELOG.md)
- **Behavior changed** `has_key?`  

The has_key? method is now indifferent to key type, accepting either String or Symbol. [github.com](https://github.com/sinatra/sinatra/blob/v2.0.0/CHANGELOG.md)
- **Behavior changed** `not_found`  

The not_found and error handlers now share 404 behavior, which can change responses for apps that define both. [github.com](https://github.com/sinatra/sinatra/blob/v2.0.0/CHANGELOG.md)
- **Behavior changed** `params`  

The params hash now uses a full IndifferentHash implementation, which can change how keys are looked up and stored. [github.com](https://github.com/sinatra/sinatra/blob/v2.0.0/CHANGELOG.md)
- **Behavior changed** `Rack.Protection.ContentSecurityPolicy`  

Rack::Protection::ContentSecurityPolicy now emits CSP Level 2 and 3 directives, which can change the headers sent. [github.com](https://github.com/sinatra/sinatra/blob/v2.0.0/CHANGELOG.md)
- **Configuration changed**  

Rack::Test moved to a development dependency, so apps needing it at runtime must add it themselves. [github.com](https://github.com/sinatra/sinatra/blob/v2.0.0/CHANGELOG.md)
- **Configuration changed**  

APP_ENV is now preferred and recommended over RACK_ENV for setting the environment, so apps relying on RACK_ENV should set APP_ENV. [github.com](https://github.com/sinatra/sinatra/blob/v2.0.0/CHANGELOG.md)

## Related packages

- [rack-protection](https://since.dev/packages/gem/rack-protection.md)
- [sinatra-contrib](https://since.dev/packages/gem/sinatra-contrib.md)

## Check your code

These are the changes. To see which of them reach your code, [scan a public repository](https://since.dev/scan.md), or have your coding agent call `check_code` with your manifest or lockfile over [MCP](https://since.dev/docs.md#mcp). [The API](https://since.dev/docs.md#api) reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

## Put your code on continuous maintenance.

Scan a public repository now, or give your agent one line.

[Scan a repository](https://since.dev/scan.md). Any public GitHub repository. No sign-in.

### Tell your agent what changed since it was trained.

`claude mcp add --transport http since https://api.since.dev/mcp`

[Get an API key](https://app.since.dev/login?mode=signup)

Codex, Cursor and any MCP client use https://api.since.dev/mcp.

---

Every page on this site as Markdown: https://since.dev/sitemap.md. For agents: https://since.dev/llms.txt.
