Skip to content

Instantly share code, notes, and snippets.

@ognevsky
Created November 2, 2010 09:16
Show Gist options
  • Save ognevsky/659406 to your computer and use it in GitHub Desktop.
Save ognevsky/659406 to your computer and use it in GitHub Desktop.
using several versions of ruby w/o rvm
function r19 {
switch-ruby $(brew --prefix)/Cellar/ruby/1.9.2-p0/bin
}
function r18 {
switch-ruby $(brew --prefix)/Cellar/ruby-enterprise-edition/2010.02/bin
}
function switch-ruby {
echo "using $1"
export PATH=$(ruby -e 'puts ENV["PATH"].split(":").map { |p| p =~ /\bruby\b/ ? ARGV[0] : p }.uniq.join(":")' $1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment