Community Oriented

Gems

Web Based

Projects For Me

RVM Aliases

Ease transitioning between Rubies, 20 Aug 2011

RVM is my favourite way to manage the Rubies on my system. To switch to Ruby 1.9.2, I just type rvm use 1.9.2. But, it always wants to use the newest version that exists, not the newest version I've got installed. Which means at some point I'll have to switch to rvm use 1.9.2-p180. To ease this, I've set up some aliases that will look up the latest version and use that. I've grown to really enjoy these, so figured I'd share them.

alias rrbx=" rvm use \$(rvm list strings | grep -i rbx | tail -1)"
alias rmac=" rvm use \$(rvm list strings | grep -i macruby | tail -1)"
alias rjav=" rvm use \$(rvm list strings | grep -i jruby | tail -1)"
alias r186=" rvm use \$(rvm list strings | grep -i 1.8.6 | tail -1)"
alias r187=" rvm use \$(rvm list strings | grep -i 1.8.7 | tail -1)"
alias r191=" rvm use \$(rvm list strings | grep -i 1.9.1 | tail -1)"
alias r192180=" rvm use \$(rvm list strings | grep -i 1.9.2-p180 | tail -1)"
alias r192=" rvm use \$(rvm list strings | grep -i 1.9.2 | tail -1)"
alias r193=" rvm use \$(rvm list strings | grep -i 1.9.3 | tail -1)"

I'm slowly building up these and other useful shell scripts in my dotfiles. Check them out, let me know if you find anything useful. If you have any great aliases/functions/scripts share them below!

blog comments powered by Disqus