-
-
Save voanhduy1512/c7c33225a32145bd4fa46c426934d453 to your computer and use it in GitHub Desktop.
Overwrite bundler in nixpkgs on MacOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ buildRubyGem, makeWrapper, ruby, coreutils }: | |
buildRubyGem rec { | |
inherit ruby; | |
name = "${gemName}-${version}"; | |
gemName = "bundler"; | |
version = "2.0.2"; | |
source.sha256 = "1l5203dhf51dnchrd2lxlvqgikx763jz323imhrbhwm0x3yf2ajc"; | |
dontPatchShebangs = true; | |
postFixup = '' | |
sed -i -e "s/activate_bin_path/bin_path/g" $out/bin/bundle | |
''; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
bundlerOverlay = self: super: rec { | |
bundler = super.callPackage ./bundler.nix {}; | |
}; | |
pkgs = import <nixpkgs> { overlays = [bundlerOverlay]; }; | |
in | |
with pkgs; | |
stdenv.mkDerivation rec { | |
name = "env"; | |
buildInputs = [ | |
ruby | |
bundix | |
]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[nix-shell:~/Projects/learn_nix]$ bundle --version | |
Bundler version 2.0.2 | |
[nix-shell:~/Projects/learn_nix]$ bundix --version | |
Traceback (most recent call last): | |
8: from /nix/store/dzyrq31c6f9hk7nhcz1avyw1f827v5w2-bundix-2.4.2/bin/.bundix-wrapped:18:in `<main>' | |
7: from /nix/store/phsfraakzj9wssr6qjgjkj4lgnw98k06-ruby-2.5.5/lib/ruby/2.5.0/rubygems.rb:304:in `activate_bin_path' | |
6: from /nix/store/phsfraakzj9wssr6qjgjkj4lgnw98k06-ruby-2.5.5/lib/ruby/2.5.0/rubygems.rb:304:in `synchronize' | |
5: from /nix/store/phsfraakzj9wssr6qjgjkj4lgnw98k06-ruby-2.5.5/lib/ruby/2.5.0/rubygems.rb:305:in `block in activate_bin_path' | |
4: from /nix/store/phsfraakzj9wssr6qjgjkj4lgnw98k06-ruby-2.5.5/lib/ruby/2.5.0/rubygems/specification.rb:1440:in `activate' | |
3: from /nix/store/phsfraakzj9wssr6qjgjkj4lgnw98k06-ruby-2.5.5/lib/ruby/2.5.0/rubygems/specification.rb:1458:in `activate_dependencies' | |
2: from /nix/store/phsfraakzj9wssr6qjgjkj4lgnw98k06-ruby-2.5.5/lib/ruby/2.5.0/rubygems/specification.rb:1458:in `each' | |
1: from /nix/store/phsfraakzj9wssr6qjgjkj4lgnw98k06-ruby-2.5.5/lib/ruby/2.5.0/rubygems/specification.rb:1469:in `block in activate_dependencies' | |
/nix/store/phsfraakzj9wssr6qjgjkj4lgnw98k06-ruby-2.5.5/lib/ruby/2.5.0/rubygems/dependency.rb:312:in `to_specs': Could not find 'bundler' (~> 1.11) - did find: [bundler-2.0.2] (Gem::MissingSpecVersionError) | |
Checked in 'GEM_PATH=/nix/store/q3r2srizfwwzp5sr4vks9gxkvrfammiq-bundler-2.0.2/lib/ruby/gems/2.5.0:/nix/store/dzyrq31c6f9hk7nhcz1avyw1f827v5w2-bundix-2.4.2/lib/ruby/gems/2.5.0:/nix/store/phsfraakzj9wssr6qjgjkj4lgnw98k06-ruby-2.5.5/lib/ruby/gems/2.5.0', execute `gem env` for more information |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version' | |
"19.09pre185424.5bcc6cecb35" |
try
let
bundlerOverlay = self: super: rec {
bundler = super.callPackage ./bundler.nix {};
bundix = super.bundix.override { bundler = super.bundler; };
};
pkgs = import <nixpkgs> { overlays = [bundlerOverlay]; };
in
with pkgs;
stdenv.mkDerivation rec {
name = "env";
buildInputs = [
bundler
bundix
];
}
Actually doesn't fix
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
try
Same problem