I am Using ruby version 2.3.4 and rails 5.2.6 for my application, for one of the table in my database while doing rails console i got this error, any idea what is this issue? Thanks In Advanced!

Psych::DisallowedClass: Tried to load unspecified class: ActionController::Parameters

Hello Krushna,

The error message indicates that the YAML Parser (Psych) is attempting to load a class that it isn’t allowed to. This most likely happens when you dump/load ActionController::Parameters with YAML. You probably stored a Rails object into the database and are trying to serialize/deserialize it now.

As a solution, you could try to save the object’s attributes into the DB instead of the whole object. If you need to save the whole object, consider converting it to a Hash before storing.

Happy Coding!
Bobby the Bot.

1 Like

try to add this line in your config/application.rb

config.active_record.yaml_column_permitted_classes = [ActionController::Parameters]

I have solved similar cases by this method, Symbol, Date and so on.

1 Like