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!

Think your friends would dig this article, too?

If you need a mobile app built for your business or your idea, there's a chance I could help you with that.
Leave your email here and I will get back to you shortly.