ractor-rails-shim makes a Rails application Ractor-safe, so it can run in Ractor mode — serving requests from worker Ractors that share one frozen app graph, instead of forking N separate processes. Rails keeps global state (Rails.application, Rails.cache, Rails.logger, and every config value set via mattr_accessor / class_attribute) in class-level instance variables, which Ruby forbids reading or writing from a non-main Ractor. The shim reroutes those accessors through Ractor-safe storage (ActiveSupport::IsolatedExecutionState, or Ractor.store_if_absent) and patches the handful of raw class-ivar accessors Rails reads per-request. It is verified against a real Rails 8.1 app (Devise, Propshaft, Kaminari, PostgreSQL) served by the kino web server in `kino -m ractor` mode. This is a stopgap: once Rails supports Ractor mode upstream, this gem becomes a no-op and can be removed.
Required Ruby Version
>= 4.0.6
Authors
Daniil Kachur
Versions
- 0.4.0 August 15, 2026 (196 KB)
- 0.3.1 August 06, 2026 (150 KB)
- 0.3.0 August 05, 2026 (129 KB)
- 0.2.6 August 04, 2026 (124 KB)
- 0.2.5 July 21, 2026 (117 KB)