bobvanderlinden / nixpkgs-ruby

A Nix repository with all Ruby versions being kept up-to-date automatically

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gemset.nix no such file or directory

crobbo opened this issue · comments

I followed the development shell instructions to a tee and I keep hitting the same error:

error: getting status of '/nix/store/7am6vdkb1r04dl7plp338kn7084j2p59-source/gemset.nix': No such file or directory

I can get around this by using the absolute path to gemset.nix in the flake.nix and the running nix develop --impure

Then I am hit with this.

warning: Git tree '/home/christian/code/my-repo' is dirty
error: hash mismatch in fixed-output derivation '/nix/store/97kc90cab4kxrwil8yyhva5m6hv2m0fy-nokogiri-1.16.0.gem.drv':
         specified: sha256-EMCPJGCFcJeQ6mKLX6AxzyPa3YQ+FzcRszW6Yoe1nQo=
            got:    sha256-NBOIGE6XXQkebjjOPzsziL+35Kw9eQ79jjkSSEQEC9E=
error: 1 dependencies of derivation '/nix/store/3s9wyrlfv7mjld4xwgprc79r2rqjmas3-ruby3.1.3-nokogiri-1.16.0.drv' failed to build
error: 1 dependencies of derivation '/nix/store/3dbqsy7q7l931p6211c2yf8p9m39l25h-gemset.drv' failed to build
error: 1 dependencies of derivation '/nix/store/lpqifg7qjyfywpxnpk0paqfxbigjlbny-nix-shell-env.drv' failed to build

I feel like the last error is unrelated to this repo but having to use an absolute path for my gemset.nix is? Any suggestions how I can resolve this?

What I commonly run into is forgetting to add/stage the gemset.nix file into git. Without doing that, Nix is not able to find it.

Thanks, this allowed me to overcome my problem 👍🏻

Apologies if this is the wrong place to ask but I'm struggling to find an answer.

I'm using this with a Ruby on Rails app. In my gemset.nix file lots of gems use the same rails git repo, for example these two:

  actioncable = {
    dependencies = ["actionpack" "activesupport" "nio4r" "websocket-driver" "zeitwerk"];
    groups = ["default" "development"];
    platforms = [];
    source = {
      fetchSubmodules = false;
      rev = "1f6cef4ca546b3a9f7aa12c0f10c7d1d1cfbab5a";
      sha256 = "0fk0a0kq1wcgdnccpxix7r7x2y21awh2ipi808gy7wma5rgayxm9";
      type = "git";
      url = "https://github.com/rails/rails.git";
    };
    version = "7.2.0.alpha";
  };
  actionmailbox = {
    dependencies = ["actionpack" "activejob" "activerecord" "activestorage" "activesupport" "mail"];
    groups = ["default"];
    platforms = [];
    source = {
      fetchSubmodules = false;
      rev = "1f6cef4ca546b3a9f7aa12c0f10c7d1d1cfbab5a";
      sha256 = "0fk0a0kq1wcgdnccpxix7r7x2y21awh2ipi808gy7wma5rgayxm9";
      type = "git";
      url = "https://github.com/rails/rails.git";
    };
    version = "7.2.0.alpha";
  };

This leads to collision issues, are you familiar with how to work around this?

I haven't used gemset.nix in a long time and am not actively working on any Rails projects anymore. Sorry 😅