How to use bundler if the target node has no internet connection?

11 Feb 2016

You might be asking, “How can I use bundler to make dependencies work on a server without an internet connection?”

Now, the reason for that could be security — you don’t want an internal app to ever reach out to the outer world, for security reasons or otherwise.

The good news is, that is easily achieved following these three steps:

  1. On your development machine, cache the gems required by your applications into vendor/cache directory:

    bundle package --all --all-platforms

    This will package all required gems into vendor/cache, for all platforms (that ensures that using different platforms for development and deployment won’t be an issue).

    Remember to run that command any time you update dependencies.

  2. Make sure vendor/cache is checked into source control so that the offline machine can use it to install the gems.

  3. Once deployed to the node without internet, run

    bundle install --local

    It will use the cached gems and not try to go to

Boom. That’s it! Your intranet app is good now!

Want to level up your React skills?

Sign up below and I'll send you content just like this about React straight to your inbox every week.

No spam, promise. I hate it as much as you do!

, enjoying the article? Now think of 3 friends who are interested in Ruby and would be into it, and share the link with them! 👇