Merge pull request #255128 from PuercoPop/ruby-document-extraConfigPaths

ruby: document extraConfigPaths option from bundlerEnv
This commit is contained in:
Mario Rodas 2023-09-15 08:13:32 -05:00 committed by GitHub
commit 3b1f3712a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,6 +121,16 @@ One common issue that you might have is that you have Ruby 2.6, but also `bundle
mkShell { buildInputs = [ gems (lowPrio gems.wrappedRuby) ]; } mkShell { buildInputs = [ gems (lowPrio gems.wrappedRuby) ]; }
``` ```
Sometimes a Gemfile references other files. Such as `.ruby-version` or vendored gems. When copying the Gemfile to the nix store we need to copy those files alongside. This can be done using `extraConfigPaths`. For example:
```nix
gems = bundlerEnv {
name = "gems-for-some-project";
gemdir = ./.;
extraConfigPaths = [ "${./.}/.ruby-version" ];
};
```
### Gem-specific configurations and workarounds {#gem-specific-configurations-and-workarounds} ### Gem-specific configurations and workarounds {#gem-specific-configurations-and-workarounds}
In some cases, especially if the gem has native extensions, you might need to modify the way the gem is built. In some cases, especially if the gem has native extensions, you might need to modify the way the gem is built.