Created
December 20, 2012 00:12
-
-
Save mislav/4341946 to your computer and use it in GitHub Desktop.
emove current rbenv version from PATH so that when we shell out, it resolves the current ruby again.
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
rbenv_root = `rbenv root 2>/dev/null`.chomp | |
unless rbenv_root.empty? | |
re = /^#{Regexp.escape rbenv_root}\/(versions|plugins|libexec)\b/ | |
paths = ENV["PATH"].split(":") | |
paths.reject! {|p| p =~ re } | |
ENV["PATH"] = paths.join(":") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment