Skip to content

Instantly share code, notes, and snippets.

@mislav
Created December 20, 2012 00:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mislav/4341946 to your computer and use it in GitHub Desktop.
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.
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