Updating Ruby Gems in Nix 0 ▲ Suffix 1 day ago · Tech · hide I manage my Ruby on Rails projects with Nix. Each project has a `flake.nix` that sets up all the dependencies for the development environment, so starting work is as simple as running nix develop in the project directory. This setup is great for reproducibility, except when it’s time to update gems. When I run bundle update inside my flake’s dev shell, Bundler will immediately stop me: $ bundle update Bundler is unlocking, but the lockfile can’t be updated because frozen mode is set Trying to unset the flag or override it with BUNDLE_FROZEN=0 did’t work. When Nix packages the Ruby environment, it wraps the `bundle` and `ruby` binaries with BUNDLE_FROZEN=1 hardcoded and points GEM_HOME to a read-only `/nix/store/...` path. Because the Nix store is immutable, Bundler isn’t allowed to download or write new gems there anyway. The Fix: Use an Ephemeral Nix Shell Instead of fighting the wrapped binaries inside the flake environment, the cleanest way to update the dependencies is to… Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town