I am using NixOS 24.05 without Ruby installed.
> nixos-version
24.05.3346.8c5066250910 (Uakari)
> ruby -v
The program 'ruby' is not in your PATH.
Starting a new shell with ruby_3_3 gives me access to Ruby 3.3.3 as expected since this is what search.nixos.org lists as the version.
> nix-shell -p ruby_3_3
$ ruby -v
ruby 3.3.3 (2024-06-12 revision f1c7b6f435) [x86_64-linux]
So far so good.
Now, for my Ruby on Rails development environment I use a flake which has been updated with nix flake update:
{
inputs = {
nixpkgs.url = "nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
env = pkgs.bundlerEnv {
name = "bundler";
ruby = pkgs.ruby_3_3;
gemdir = ./.;
};
in with pkgs; {
devShells.default = mkShell {
buildInputs = [
bundix
env
ruby_3_3
];
};
});
}
When I start the development shell I get Ruby 3.3.2, not Ruby 3.3.3.
> nix develop # in the same directory as the flake.nix mentioned above
$ ruby -v
ruby 3.3.2 (2024-05-30 revision e5a195edf6) [x86_64-linux]
How come the ruby_3_3 package in NixOS and in my flake points to different versions?
Thank you!