." generated with nRonn/v0.11.1 ." github.com/n-ronn/nronn/tree/0.11.1 .TH “BUNDLE-CACHE” “1” “October 2024” “” .SH “NAME” fBbundle-cachefR - Package your needed fB.gemfR files into your application .SH “SYNOPSIS” fBbundle cachefR .P alias: fBpackagefR, fBpackfR .SH “DESCRIPTION” Copy all of the fB.gemfR files needed to run the application into the fBvendor/cachefR directory. In the future, when running fBbundle install(1)fR fIbundle-install.1.htmlfR, use the gems in the cache in preference to the ones on fBrubygems.orgfR. .SH “GIT AND PATH GEMS” The fBbundle cachefR command can also package fB:gitfR and fB:pathfR dependencies besides .gem files. This needs to be explicitly enabled via the fB--allfR option. Once used, the fB--allfR option will be remembered. .SH “SUPPORT FOR MULTIPLE PLATFORMS” When using gems that have different packages for different platforms, Bundler supports caching of gems for other platforms where the Gemfile has been resolved (i.e. present in the lockfile) in fBvendor/cachefR. This needs to be enabled via the fB--all-platformsfR option. This setting will be remembered in your local bundler configuration. .SH “REMOTE FETCHING” By default, if you run fBbundle install(1)fR fIbundle-install.1.htmlfR after running bundle cache(1) fIbundle-cache.1.htmlfR, bundler will still connect to fBrubygems.orgfR to check whether a platform-specific gem exists for any of the gems in fBvendor/cachefR. .P For instance, consider this Gemfile(5): .IP “” 4 .nf source “rubygems.org”
gem “nokogiri” .fi .IP “” 0 .P If you run fBbundle cachefR under C Ruby, bundler will retrieve the version of fBnokogirifR for the fB“ruby”fR platform. If you deploy to JRuby and run fBbundle installfR, bundler is forced to check to see whether a fB“java”fR platformed fBnokogirifR exists. .P Even though the fBnokogirifR gem for the Ruby platform is fItechnicallyfR acceptable on JRuby, it has a C extension that does not run on JRuby. As a result, bundler will, by default, still connect to fBrubygems.orgfR to check whether it has a version of one of your gems more specific to your platform. .P This problem is also not limited to the fB“java”fR platform. A similar (common) problem can happen when developing on Windows and deploying to Linux, or even when developing on OSX and deploying to Linux. .P If you know for sure that the gems packaged in fBvendor/cachefR are appropriate for the platform you are on, you can run fBbundle install --localfR to skip checking for more appropriate gems, and use the ones in fBvendor/cachefR. .P One way to be sure that you have the right platformed versions of all your gems is to run fBbundle cachefR on an identical machine and check in the gems. For instance, you can run fBbundle cachefR on an identical staging box during your staging process, and check in the fBvendor/cachefR before deploying to production. .P By default, bundle cache(1) fIbundle-cache.1.htmlfR fetches and also installs the gems to the default location. To package the dependencies to fBvendor/cachefR without installing them to the local install location, you can run fBbundle cache --no-installfR. .SH “HISTORY” In Bundler 2.1, fBcachefR took in the functionalities of fBpackagefR and now fBpackagefR and fBpackfR are aliases of fBcachefR.