Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize bundler version #72

Open
ryansch opened this issue May 4, 2023 · 1 comment · Fixed by cachix/devenv#579
Open

Customize bundler version #72

ryansch opened this issue May 4, 2023 · 1 comment · Fixed by cachix/devenv#579

Comments

@ryansch
Copy link

ryansch commented May 4, 2023

I'm currently using this project via devenv.sh with the following configuration:

  # https://devenv.sh/languages/
  languages.ruby.enable = true;
  # Uses bobvanderlinden/nixpkgs-ruby to supply any version of ruby
  languages.ruby.versionFile = ./.ruby-version;

I think I'm getting bundler from this project since the version devenv reports via devenv update isn't available.

How do I update bundler?

@bobvanderlinden
Copy link
Owner

bobvanderlinden commented May 4, 2023

Hmm, interesting. Bundler is shipped with Ruby nowadays, so the Ruby packages have it in /bin/bundle:

$ nix build github:bobvanderlinden/nixpkgs-ruby#"ruby-3" --print-out-paths 
/nix/store/52k5x0jcrxxx857ilizpiafk8fy7rfa1-ruby-3.2.2
$ ls -l /nix/store/52k5x0jcrxxx857ilizpiafk8fy7rfa1-ruby-3.2.2/bin
/nix/store/52k5x0jcrxxx857ilizpiafk8fy7rfa1-ruby-3.2.2/bin/bundle

That means if there is no other bundler package available it will pick the one shipped with Ruby.

The Ruby module in devenv places the bundler package from nixpkgs below the Ruby package:

https://github.com/cachix/devenv/blob/a908c8bb7d21f97e1aff3489307087fa68913e5d/src/modules/languages/ruby.nix#L84-L87

Maybe that prioritizes the bundler from nixpkgs lower than the one from Ruby and thus the one from Ruby ends up in the devenv profile?

Does it help to add packages = lib.mkBefore [ pkgs.bundler ]; to devenv.nix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants