Shenzhen Gem Errors

We have had several users report the following errors when using Shenzhen on OS X containers.

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:1206:in `block in activate_dependencies': can't satisfy 'highline (>= 1.7.2)', already activated 'highline-1.6.21' (Gem::LoadError)
 from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:1198:in `each'
 from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:1198:in `activate_dependencies'
 from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:1180:in `activate'
 from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:48:in `gem'

In all cases, the users getting the error were installing Shenzhen in their circle.yml. We already preinstall Shenzhen, so this ended up installing two versions of the gem (the one installed during the build is newer, ours is older) and two sets of dependencies. Both Highline 1.7.2 and 1.6.21 are installed because of those two sets of dependencies, and so Ruby gets confused.

The solution is to either remove our version with gem uninstall shenzhen before installing it during the build, or to just stop installing shenzhen and use the pre-baked version.

Credits: originally posted by @alexey