20 cards
Posted 26 days ago. Visible to the public.

Fixing 'uninitialized constant / undefined class/module ActionDispatch::Http::ParamsHashWithIndifferentAccess' when migrating away from Rails LTS

Rails 2.3 and 3.0 LTS use ActionDispatch::Http::ParamsHashWithIndifferentAccess to represent params hashes, similar to Rails 5's ActionController::Parameters.

If you serialize data in Rails LTS, then upgrade to Rails 5, and then try to deserialize the data, you might run into an error

uninitialized constant ActionDispatch::Http::ParamsHashWithIndifferentAccess


undefined class/module ActionDispatch::Http::ParamsHashWithIndifferentAccess

To fix this, add the following line to an initializer in your Rails 5 app:

ActionDispatch::Http::ParamsHashWithIndifferentAccess = ActionController::Parameters

You can do this either temporarily in order to migrate all serialized data once, or keep it permanently.

Owner of this card:

Tobias Kraze
Last edit:
25 days ago
by Tobias Kraze
This website uses cookies to improve usability and analyze traffic.
Accept or learn more