How does RVM detect when you've changed directories?

后端 未结 2 1302
失恋的感觉
失恋的感觉 2020-12-14 02:09

One thing that RVM can do is notice when you\'ve changed directories, look for an .rvmrc, and change your current Ruby version and gemset according to that file

2条回答
  •  醉话见心
    2020-12-14 02:24

    When you install RVM you have to add:

    [[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm
    

    to your shell config (usually .bashrc or .zshrc).

    This loads RVM when you start a shell which then overrides your cd command and checks for .rvmrcs as you move around. See the contents of $HOME/.rvm/scripts/cd for more details.

提交回复
热议问题