Closed countingtoten closed 9 years ago
I'm constantly bitten by this too.
I think it's because I declare a default ruby in my .bash_profile after I load the chruby and auto scripts, but I don't know how to fix it...
# ~/.bash_profile
if [ -n "$BASH_VERSION" ] || [ -n "$ZSH_VERSION" ]; then
source /usr/local/share/chruby/chruby.sh
source /usr/local/share/chruby/auto.sh
fi
chruby ruby-2.1.5
Yep that will override the current ruby. Better to just upgrade system ruby to your desired version. Or create a ~/.ruby-version
file.
I suppose .bashrc
/.zshrc
could also check to see if pwd
has a .ruby-version
and then source that, to handle a new terminal tab starting out in a non-~
directory?
On Mac OS X 10.10.2 opening a new Terminal tab doesn't keep the .ruby-version even though we are in the same directory.
$ ruby -v ruby 2.1.5p273 ... $ cd ~/Code/project $ ruby -v jruby 1.7.9 (1.9.3p392) ... Cmd+T to create a new tab $ ruby -v ruby 2.1.5p273 ... $ cd ../ $ cd project $ ruby -v jruby 1.7.9 (1.9.3p392) ...