armature not getting attached to mesh
This is the procedure to have your file working OK: select the rig and delete it. Select the Metarig and press Ctrl A &quot;Apply all transform&quot;.
In the Rigify properties enable &quot;advanced options&quot;, delete target rig and target UI and choose new (with a new name) as destination.
Press Generate rig.
Hide the Metarig.
Select the mesh, shift select the new rig (the order of selection is important), choose &quot;with automatic weights&quot; option.
The advanced option is necessary only if you generate a bad rig (wrong unapplied scale) and later you try to generate a new one: some conflict can arise between old rig (even if deleted) and new one.