Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
758 views
in Technique[技术] by (71.8m points)

linux - How to change rvm install location?

Currently I have rvm installed under /home/john/.rvm

How do move rvm to the location /opt/local/rvm ?

I tried to use the rvmrc file to take care of this (according to the rvm document here: https://rvm.io/workflow/rvmrc/ ) but no luck, I found a rvmrc file under /etc/

Is there any step by step instruction I could follow?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Figure out myself by doing some research online, hope this can help someone out:

Suppose you want to move from home/username/.rvm to /opt/local/rvm

  1. Update you .bash_profile or .bashrc to:

    if [ -s "$HOME/.rvmrc" ]; then
        source "$HOME/.rvmrc"
    fi # to have $rvm_path defined if set
    if [ -s "${rvm_path-$HOME/.rvm}/scripts/rvm" ]; then
        source "${rvm_path-$HOME/.rvm}/scripts/rvm"
    fi
    
  2. find your .rvmrc under $HOME/.rvmrc, if not found, create one and put this line in it:

    export rvm_path=/opt/local/rvm

  3. move your file to the new location : mv $HOME/.rvm/* /opt/local/rvm
  4. execute rvm repair all and rvm reload

And you are good to go!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...