title: NoMethodError: undefined method `marshal_dump' for #<ActiveModel::Errors:0x0000000006fcbba0>
body: <p>We use below ruby and rails version -</p>
  <p>Ruby 2.7.3 Rails 6.1.3.2</p>
  <p>While creating a new user it throws the below error -</p>
  <pre><code>NoMethodError (undefined method `marshal_dump' for #ActiveModel::Errors:0x0000000006fcbba0 Did you mean? marshal_load):
  app/controllers/user_controller.rb:33:in `create'
  </code></pre>
  <p>Below Create method defined in the controller -</p>
  <pre><code>def create
  
     @user = User.new(user_params)
  
     respond_to do |format|
     if @user.save
        format.html { redirect_to @user, notice: 'User successfully created.' }
        format.json { render :show, status: :created, location: @user }
     else
        format.html { render :new }
        format.json { render json: @user.errors, status: :unprocessable_entity }
     end
    end
   end
  </code></pre>