Installing gems on a server that has no access to the internet (especially rubygems.org
) requires to bundle the gems into the repository itself. This requires to adjust the bundle config in the repository.
- Execute the following commands to configure bundler:
bundle config set --local path vendor
bundle config set --local disable_shared_gems true
Note
For Bundler < 2 you have to omit the "set":
bundle config --local name value
.
See here: https://bundler.io/v1.17/man/bundle-config.1.html Show archive.org snapshot
This will create a file .bundle/config
with the following content.
---
BUNDLE_PATH: "vendor/"
BUNDLE_DISABLE_SHARED_GEMS: "true"
- Change your
.gitignore
.
# Make sure to check in .bundle
# /.bundle/
/vendor/ruby
- Run
bundle package
and commit the changes together with all gems invendor/cache/
.
Afterwards you can run bundle install --local
and install all gems without an internet connection. Changing gems in your Gemfile
will automatically change the file in vendor/cache
henceforth and no further bundle package
is required.
Posted by Emanuel to makandra dev (2021-04-14 11:21)