Getting “Warning! PATH is not properly set up” when doing rvm use 2.0.0 --default

前端 未结 16 1052
不思量自难忘°
不思量自难忘° 2020-12-02 04:35

Above doesn\'t work first time, works 2nd time.

Try to set ruby version to 2.0.0 for any new shell windows.

Doing

$ rvm use 2.0.0 --default
<         


        
16条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-02 04:49

    Disclaimer

    Cuz I mainly develop using python, so I am not sure the would this workaround give you a correct ruby env or just change the path and get rid of the warning

    Background

    In my case, I installed rvm first, and then pyenv later. The config for both of them will change $PATH. From the warning, it seems that rvm always want to be the first in the path

    $ echo $PATH

    $HOME/.rvm/gems/ruby-2.6.3/bin: ......

    But if you add eval "$(pyenv init -)" as required by pyenv, it will change your $PATH to

    $ echo $PATH

    $HOME/.pyenv/shims:$HOME/.rvm/gems/ruby-2.6.3/bin: ......

    My workaround

    $ rvm use system # Switch back to system ruby

    $ rvm use ruby-2.6.3 # Switch to the version you need to use

    rvm will change the path to what it likes then you won't see the annoying warning again.

提交回复
热议问题