Replace gem root first.

This solves the issue of the bundle path being inside the project root.