Using "gem install" didn't work for me because of the Gemfile.lock that is in source control (presumably for a reason).
Existing copy is wrong because "git rm -rf *" fails if there are any untracked files (e.g. target/). Changed to "git rm -rf `git ls-files`".