Skip to content

Commit

Permalink
doc: Instruct to generate Gemfile.lock file in Nix
Browse files Browse the repository at this point in the history
The lockfile is used for generating gemset.nix using bundix.

In Nix (but not in the Docker image), github-pages/jekyll fail with the
error below if the lockfile is missing, due to BUNDLE_FROZEN being set
in all binstubs[1]:

  /nix/store/z115...-ruby-3.3.4/lib/ruby/3.3.0/bundler/definition.rb:450:in
  `validate_platforms!': Your bundle only supports platforms [] but your
  local platform is arm64-darwin. Add the current platform to the
  lockfile with `bundle lock --add-platform arm64-darwin` and try again.

Note however that the Gemfile.lock file should not be tracked by Git, as
instructed in the documentation for GitHub Pages[2]. This is because the
builder image[3] comes with all the allowed Gem dependencies of
github-pages pre-installed, and doesn't offer facilities for installing
additional Gems.

[1]: https://github.com/inscapist/ruby-nix/blob/v0.2.1/modules/ruby-env/gen-bin-stubs.rb#L52
[2]: https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/creating-a-github-pages-site-with-jekyll
[3]: https://github.com/actions/jekyll-build-pages
  • Loading branch information
antoineco committed Sep 7, 2024
1 parent 7d03a20 commit 036c442
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ covered by [ISC][isc].

### Using Nix

```sh
nix develop --command bundle-lock
```

```sh
nix develop --command jekyll serve --drafts
```
Expand Down

0 comments on commit 036c442

Please sign in to comment.