Just use four metal dinosaur gates and a large bear trap then place one be hind him.
—
/ @ \ then place a gate and the @ (bear trap) while get him and you can place the gate behind him.