He set up a trap for Captain Hook'sminions, but unfortunately, Rigger Greene stumbled into it instead. When Erik went back to the trap to free the pirate, he was caged and placed in a nearby cell.
Mickey can thin out the bars to the cell and smash Erik's cage to free him. Erik explains his story and opens the cage. Erik says that he doesn't have anything on him to give Mickey as thanks, but suggests that Rigger Greene might let the mouse have some treasure, which he does.