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
Authors
dev