Breedly Breedly - 4 months ago 12x
Ruby Question

Tar a bundler project and send to another system

I have two systems that use the same command line interface written in ruby. One system is using an older version that's incompatible with the scripts we have written. We'd like to use bundler to download all the dependencies for the

on our own system, and then migrate that
over to the system with the older version so that we can use
there as well.

We do not have the option to run
bundle install
on the other system because it's not open to the internets.

So the idea is on my system:

bundle init


bundle install

tar -czf cli2.0.tar.gz ./Gemfile ./Gemfile.lock ./.bundle ./bundle

... move
to the other system ...

On system B:

tar -zxf cli2.0.tar.gz

bundle exec cli2.0 version

But at this point we get an error stating that
couldn't find any of the gems even though they're right there under

It looks like they have different versions of
, and


Received some help from a coworker, the gist is I was doing it all wrong.

If you want to transport gems and see consistent performance with bundler do this.

  1. bundle install <gem>
  2. bundle package
    • This creates a cache of the downloaded gems for transport.
  3. tar -czf ./transport.tar.gz ./Gemfile ./Gemfile.lock ./vendor

On the next machine:

  1. tar -xzf ./transport.tar.gz
  2. bundle exec <command>