nix-shell找不到标准属性

问题描述 投票:0回答:1

我正在运行nixos 19.09,并尝试遵循instructions创建一个ruby包。但是在第一步中,我遇到一个错误,即找不到withPackages属性。

命令:$ nix-shell -p "ruby.withPackages (ps: with ps; [ nokogiri pry ])" --show-trace

结果:

while evaluating the attribute 'buildInputs' of the derivation 'shell' at /nix/store/b6cqdsczmwxfkmc65483x7fgwdl129ar-nixpkgs-19.03.173684.c8db7a8a16e/nixpkgs/pkgs/build-support/trivial-builders.nix:7:14:
while evaluating 'getOutput' at /nix/store/b6cqdsczmwxfkmc65483x7fgwdl129ar-nixpkgs-19.03.173684.c8db7a8a16e/nixpkgs/lib/attrsets.nix:464:23, called from undefined position:
while evaluating anonymous function at /nix/store/b6cqdsczmwxfkmc65483x7fgwdl129ar-nixpkgs-19.03.173684.c8db7a8a16e/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:141:17, called from undefined position:
attribute 'withPackages' missing, at (string):1:94

我猜我以某种方式弄乱了我的nix存储,但是我不知道如何调试它。

其他信息

$ echo $NIX_PATH
$HOME/.nix-defexpr/channels:nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels
$ nix-channel --list
nixpkgs https://nixos.org/channels/nixos-19.03
unstable https://nixos.org/channels/nixos-unstable
$ sudo nix-channel --list
<blank>
nix nixos nix-shell
1个回答
0
投票

[@ RobertHensing指出我看起来像在19.03,并要求我打印频道后,我尝试仅更新频道列表以指向19.09而不是19.03(使用nix-channel --add),然后修复了它。

© www.soinside.com 2019 - 2024. All rights reserved.