Created
November 16, 2012 21:57
-
-
Save michaelwclark/4091266 to your computer and use it in GitHub Desktop.
Command line command for getting current active version of Ruby. Tested on OSX 10.8.2 w/ zsh and iTerm2. RVM + iTerm = headaches. Hopefully this helps someone else out there..
This file contains hidden or 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
| #!/bin/bash -e | |
| echo `ruby -v | sed 's/(.*//g' | sed 's/ruby//g' |sed 's/ //g' |sed 's/[ \t]*$//'` | |
| # I realized after spending about 30 minutes on building up this command for my zsh Prompt that | |
| # rvm_ruby_string contains the same thing. | |
| # However, the reason I added this to my prompt is RVM kept giving me problems with not switching from OSX inbuilt ruby to the | |
| # current environment...so adding an indicator always helps. | |
| # I'm going to write a small shell script to fix the non-auto switching of RVM ruby versions with iTerm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment