attribute 'ruby' missing in a new project
Quintasan opened this issue · comments
I have a Ruby 3.1.2 (ruby-3.1.2
in .ruby-version
) project. I tried using nix flake init -t github:bobvanderlinden/nixpkgs-ruby#
but I'm getting error: attribute 'ruby' missing
when cd
ing into the project directory
direnv: loading ~/sauce/asi/asi.wroclaw.pl/.envrc
direnv: using flake
warning: Git tree '/home/quintasan/sauce/asi/asi.wroclaw.pl' is dirty
error: attribute 'ruby' missing
at /nix/store/r9kwh98ww53k46wrd8chqvxfs3hv9x1c-source/flake.nix:14:45:
13| getRubyVersionEntry = rubyVersion:
14| builtins.foldl' (parent: segment: parent.${segment}) self.lib.versions
| ^
15| (builtins.splitVersion rubyVersion);
(use '--show-trace' to show detailed location information)
warning: Git tree '/home/quintasan/sauce/asi/asi.wroclaw.pl' is dirty
direnv: nix-direnv: renewed cache
direnv: export ~XDG_DATA_DIRS
What am I doing wrong? I would include my flake.nix
but it's literally https://github.com/bobvanderlinden/nixpkgs-ruby/blob/master/template/flake.nix with no changes 🤔
I was able to "fix" it by doing
ruby = nixpkgs-ruby.lib.mkRuby { inherit pkgs; rubyVersion = "3.1.2"; };
which is more of a workaround 🤔
Hmm, I think your .ruby-version
contained ruby-3.1.2
and not 3.1.2
? Can you check what is in your .ruby-version
?
I know only of .ruby-version
containing solely a version and no other prefixes/suffixes.