Skip to content

Commit b161cb9

Browse files
igneuseregon
authored andcommitted
document cache-version
1 parent fa2182b commit b161cb9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,20 @@ When there is no lockfile, one is generated with `bundle lock`, which is the sam
180180
In other words, it works exactly like `bundle install`.
181181
The hash of the generated lockfile is then used for caching, which is the only correct approach.
182182

183+
#### Dealing with a corrupted cache
184+
185+
In some rare scenarios (like using gems with C extensions whose functionality depends on libraries found on the system
186+
at the time of the gem's build) it may be necessary to ignore contents of the cache and get and build all the gems anew.
187+
In order to achieve this, set the `cache-version` option to any value other than `0` (or change it to a new unique value
188+
if you have already used it before.)
189+
190+
```yaml
191+
- uses: ruby/setup-ruby@v1
192+
with:
193+
bundler-cache: true
194+
cache-version: 1
195+
```
196+
183197
#### Caching `bundle install` manually
184198

185199
It is also possible to cache gems manually, but this is not recommended because it is verbose and *very difficult* to do correctly.

0 commit comments

Comments
 (0)