Packaging/Ruby: Difference between revisions

imported>Makefu
m Makefu moved page Packaging Ruby to Packaging/Ruby
imported>Max
added bundlerEnv group example
Line 90: Line 90:


After this change we build the package again.
After this change we build the package again.
=== Defining groups ===
Sophisticated applications use groups to organize their gems like <code>development</code>, <code>test</code> and
<code>production</code>.
<code>bundlerEnv</code> only makes the <code>default</code> group available in the environment, that is all gems which are '''not''' in a group.
To make other groups available, they need to be provided as an array. Don't forget to include the <code>default</code> group.
Example:
<syntaxHighlight lang=nix>
  gems = pkgs.bundlerEnv {
    name = "exampleApp";
    inherit ruby;
    gemfile = ./Gemfile;
    lockfile = ./Gemfile.lock;
    gemset = ./gemset.nix;
    groups = [ "default" "production" "development" "test" ];
  };
</syntaxHighlight>


=== set the local gemConfig ===
=== set the local gemConfig ===
'''TODO''': also merge with the <code>defaultGemConfig</code> somehow
'''TODO''': also merge with the <code>defaultGemConfig</code> somehow