I currently have 2 ruby packages installed,
jazzy, and both use the same
claide-1.0.2 gem. Since it seems rubygems must be symlinked into
~/.nix-profile/lib/ruby/gems/2.5.0/gems, trying to install both
jazzy produces a conflict on the
claide gem, requiring me to set a priority on one of these packages.
First off, I’m actually kind of surprised ruby packages don’t get wrapped up in some sort of script that redirects the rubygems directory at the per-package lib folder, such that the gems don’t need to be linked into the profile. But ignoring that for a second, I’m left with 2 questions about this process:
- Looking into it, both
cocoapodsuse the exact same derivation for
claide-1.0.2. The way the packages work, they each re-specify the definition of
claide, but the definitions are the same so they end up at the same store path. This means both
lib/ruby/gems/2.5.0/gems/claide-1.0.2as symlinks to the same store path (
/nix/store/haq9z019vwq1q2n1diqqqn95b3v7k2y6-ruby2.5.5-claide-1.0.2/lib/ruby/gems/2.5.0/gems/claide-1.0.2). Given that they’re the exact same path, I’m kind of surprised there’s a conflict at all upon installation, though I guess the install process doesn’t care that this path is a symlink (even though the nix store is read-only so it could absolutely indirect through symlinks if it wanted to without worrying about the files changing).
- Looking at my nix profile gems, some of the gems are symlinked entirely (such as
.nix-profile/lib/ruby/gems/2.5.0/gems/ffi-1.10.0) and some are directory trees where every file in the tree is a separate symlink (such as
.nix-profile/lib/ruby/gems/2.5.0/gems/escape-0.0.4). It’s not clear to me why this is, or if that even matters.
I’m also wondering if there’s any solution here beyond setting unique priorities on the ruby packages I want to install that have overlapping gems.