Default Ruby not loading with RVM

社会主义新天地 提交于 2019-12-20 04:26:31

问题


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:


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.



来源:https://stackoverflow.com/questions/26867714/default-ruby-not-loading-with-rvm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!