inscapist / ruby-nix

Generates reproducible ruby/bundler app environment with Nix

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

env.ruby doesn't exist

jdelStrother opened this issue · comments

Heya - I notice default.nix returns a ruby attribute alongside env & envMinimal, but I don't think it actually exists.

If I try to access it -

let
  rubyNix = ruby-nix.lib pkgs;
  inherit (rubyNix {
    name = "simple-ruby-app";
    gemset = ./gemset.nix;
    # run `bundle platform` to find your platform
    gemPlatforms = [ "ruby" "arm64-darwin-20" "x86_64-linux" ];
  }) env envMinimal ruby;
in pkgs.mkShellNoCC {
  nativeBuildInputs = [env];
    # Bootsnap doesn't seem to like switching between ruby versions ("unmatched version file (2.7 for 3.0)")
  BOOTSNAP_CACHE_DIR = "tmp/cache/bootsnap-${ruby.version.majMin}";
}

then I get this error:

error: attribute 'ruby' missing

       at /nix/store/rn1gdnpf2lz7ygyxs0vddmlpd08plraa-source/default.nix:46:10:

           45|   inherit (import ./modules/ruby-env requirements) env envMinimal;
           46|   ruby = env.ruby;
             |          ^
           47| }

Fortunately I know what ruby I'm using so don't actually need the return value, but might be useful to have it in other circumstances.

commented

Thanks @jdelStrother for spotting it! Fixed here

and hey thanks for the bundix changes

No problem, glad to see some activity in the nix-ruby space