Bundle cache does not work as described in docs when using --deployment flag



I experienced an issue with attempting to cache vendor/bundle in a workflow job series. Basically what happens is that bundle install --deployment changes the bundle path to vendor/bundle, but the default bundle path in is set in the environment by BUNDLE_PATH=/usr/local/bundle

Therefore if you only restore vendor/bundle from the cache in the next workflow step, bundler will still be looking for your gems in /usr/local/bundle and will error saying your gems are not installed.

It seems like this would be an issue any time you restore a bundle from the cache and don’t run bundle install again afterward.


I managed to fix this by also caching /usr/local/bundle/config in addition to vendor/bundle, but it seems like that should probably be added to the documentation and examples.

closed #3

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.