1

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 ] 
3
  • 1
    that's the point of .ruby-version or a .rvmrc file in a project, that way the project is being run with the same dependencies and versions across all machines. Commented Nov 11, 2014 at 15:51
  • @Anthony I understand what the .ruby-version file does. That is not the issue. I merely pointed that out to demonstrate that RVM itself is being loaded and is working as expected when I initiate a new terminal session. The problem is the default Ruby I declared is not being loaded when I start a new session; instead the system default (Mac OSX included) Ruby is. Commented Nov 11, 2014 at 17:31
  • What is the output when you do rvm list? What version has the * next to it (i..e # * - default) Commented Nov 11, 2014 at 18:11

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

I had the same issue, and used this post to make oh-my-zsh honor the default rvm ruby instead of system ruby... Great so far, but still whould like to do what you wanted. 'rvm use 2.2.2@global --default' but if I do so, then the new shell/terminal defaults to using System ruby... Did you figure this out?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.