Default Ruby not loading with RVM

1.1k Views Asked by At

Not sure if this issue is related to a recent Oh-My-ZSH update, but all of a sudden, my RVM default Ruby is not loading when opening a new Terminal window (instead, it loads the system Ruby).

I have added [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" to about every dotfile on my system (.zshrc, .zprofile, .zlogin, .profile, even .bashrc and .bash_profile for good measure).

RVM is loading when the session starts (I can manually switch to the default with rvm default), and $HOME/.rvm/bin is in my $PATH. If I switch to a directory with a .ruby-version and/or .ruby-gemset file, it loads that Ruby.

EDIT: To clarify, my problem is that the default Ruby I declared with RVM (rvm use <RUBY VERSION> --default) is not being loaded when I start a new terminal session or when I cd out of a directory that has a .ruby-version file.

EDIT #2: Here is the results of rvm list

{15:20}[]~ ➭ rvm list

rvm rubies

ruby-1.9.3-p550 [ x86_64 ]
ruby-2.0.0-p594 [ x86_64 ]
ruby-2.1.3 [ x86_64 ]
* ruby-2.1.4 [ x86_64 ]
1

There are 1 best solutions below

1
On

So I half figured this out. I was attempting to set a default Ruby with the global gemset for that particular Ruby version (rvm use 2.1.4@global --default). When I set the default without the gemset, it persists and is loaded in each subsequent session.

In the past I have been able to load the default with a gemset. Not sure if this is an issue with the latest version of oh-my-zsh or rvm.