IT박스

“경고!

itboxs 2020. 8. 14. 07:32
반응형

“경고! rvm use 2.0.0 --default를 수행 할 때 PATH가 제대로 설정되지 않았습니다.


위는 처음으로 작동하지 않고 두 번째로 작동합니다.

새 쉘 창에 대해 루비 버전을 2.0.0으로 설정하십시오.

하기

$ rvm use 2.0.0 --default

준다

Warning! PATH is not properly set up, '/home/durrantm/.rvm/gems/ruby-1.9.3-p125/
bin' is not at first place,
         usually this is caused by shell initialization files - check them for '
PATH=...' entries,
         it might also help to re-add RVM to your dotfiles: 'rvm get stable --au
to-dotfiles',
         to fix temporarily in this shell session run: 'rvm use ruby-1.9.3-p125'
.
Using /home/durrantm/.rvm/gems/ruby-2.0.0-p247

그런 다음 똑같이

$ rvm use 2.0.0 --default

이제 오류가 없습니다.

$ rvm use 2.0.0 --default
Using /home/durrantm/.rvm/gems/ruby-2.0.0-p247
durrantm.../durrantm$ 

그러나 새 창은 여전히 ​​2.0.0이 아닌 루비 1.9.3을 제공합니다.

.bashrc파일에는 다음이 있습니다.

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
[[ -s "/home/durrantm/.rvm/scripts/rvm" ]] && . "/home/durrantm/.rvm/scripts/rvm"

내 .bash_profile에는 다음이 있습니다.

source ~/.profile
case $- in *i*) . ~/.bashrc;; esac

견딜 수 없는

rvm get stable

작동하는 것처럼 보이지만 많은 녹색 출력이 끝날 때 다음과 같이 표시됩니다.

Could not update RVM, get some help at #rvm IRC channel at freenode servers.

다음을 표시하는 새 터미널 창 rvm list rubies:

$ rvm list rubies
Warning! PATH is not properly set up, '/home/durrantm/.rvm/gems/ruby-1.9.3-p125/bin' is not at first place,
         usually this is caused by shell initialization files - check them for 'PATH=...' entries,
         it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
         to fix temporarily in this shell session run: 'rvm use ruby-1.9.3-p125'.

rvm rubies

=> ruby-1.9.3-p125 [ x86_64 ]
   ruby-1.9.3-p194 [ x86_64 ]
 * ruby-2.0.0-p247 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

대답은 다음과 같습니다.

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" 
# Load RVM into a shell session *as a function*

내 .bashrc 파일의 ** 하단 ** (마지막 줄-중요!) 내 .bash_profile 파일 (우분투에 있음)에 있었고 부분적으로 만 작동하여 혼란스러운 오류가 발생했습니다.


rvm을 제거한 후 멈췄습니다.

rvm implode

then after reinstalling rvm it received the same error message. After looking through wayne seguin's git hub page. He lists tools on his page and recommended using

rvm reset 

after an installation. This fixed my error message. No PATH edits needed.


Maybe is not the best way to resolve this, but I added this line at the botton of my .zshrc (it will work in .bashrc too!)

export PATH="$GEM_HOME/bin:$PATH"

I tried Michael Durrant's solution and it didn't work for me. but I ran rvm get stable --auto-dotfiles and it began working as desired.

Hope it helps


This isn't an answer to the question asked, but to the related question that most commenters/responders have asked -- Why do you need to put the rvm line at the bottom of the shell rc file?

The answer is simple.

  1. The rvm code which is loaded puts the rvm ruby binary directories at the "front" of $PATH, and
  2. .bashrc (or equivalent for your default shell) is read and interpreted line-by-line from top to bottom.

So imagine the following scenario :

$ echo $PATH
  /usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin 

$ [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
  /Users/sankalp/.rvm/gems/ruby-1.9.3-p547/bin:/Users/sankalp/.rvm/gems/ruby-1.9.3-p547@global/bin:/Users/sankalp/.rvm/rubies/ruby-1.9.3-p547/bin:/Users/sankalp/bin:/usr/texbin/:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin

$ export PATH=<something>:$PATH
$ echo $PATH
  <something>:/Users/sankalp/.rvm/gems/ruby-1.9.3-p547/bin:/Users/sankalp/.rvm/gems/ruby-1.9.3-p547@global/bin:/Users/sankalp/.rvm/rubies/ruby-1.9.3-p547/bin:/Users/sankalp/bin:/usr/texbin/:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin

Clearly if something is present in the shell init file after the RVM line and makes any changes to $PATH, more specifically if it prepends directories to $PATH, then those changes will push the directories added by rvm down from their first position. RVM, when invoked, will find that its ruby binary directories are not at the very beginning of $PATH and BAM! you'll get the warning :) .

I hope that makes things clear.


I have a follow-up question to this (wish I could simply add comment - but I don't have enough credits). I had this very same issue - and when I followed the rvm script that was suggested using --auto-dotfiles, I got into trouble as it somehow the shell script deleted my .bashrc_profile file.

Anyway, I eventually came around to the same answer listed above, putting this line at the bottom of .bashrc file. [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

Did you happen to find why that works the way it does, and not with the line in the middle of .bashrc file? Do you have some clarity around the way Unix is loading the environment variable that makes RVM work in one instance and not in another?


Just adding my experience: if you're using .bash_profile, check if .bashrc is not interfering. Killing .bashrc in favour of single Bash configuration by .bash_profile works out in this case.


I was facing same issue. I found that in bashrc file

export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
export PATH=$HOME/local/bin:$PATH

export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting

multiple entries for rvm. I commented one entry and its working fine.

#export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
#export PATH=$HOME/local/bin:$PATH

export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting

I cleaned out everything that had a .rvm in it from my PATH= line in my .zshrc

That fixed the issue for me, where the other answers here (sourcing the rvm script, or getting stable with auto dotfiles) didn't.


I have found this command to be very usefull. It solve my case. So if anyone is having the same issue, give this a try: rvm get stable --auto-dotfiles


rvm install ruby-head Fixed the issue for me - little time consuming but did the trick. Not sure if that made any unpronounced updates to my bash files.


You can add

rvm_silence_path_mismatch_check_flag=1

to your ~/.rvmrc file. That's what the warning message now suggests.


I ended up removing ~/.profile, ~/.bashrc and ~/.zshrc.

Basically I only kept ~/.bash_profile on my mac. And it works.

I think in my case, there are:

export PATH="$PATH:$HOME/.rvm/bin"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

in these files, and those duplicate settings confused rvm


It worked after commenting top 2 duplicate lines and adding them at bottom. Don't forget to restart the terminal for it to work.

#[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
#[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
export PATH="/usr/local/opt/postgresql@9.6/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/postgresql@9.6/lib"

[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

I FIXED THIS PROBLEM. TRY USE COMMAND LIKE THIS:

rvm use 2.0.0-p353

ADD -p353 or other you version detail to line end

참고URL : https://stackoverflow.com/questions/18276701/getting-warning-path-is-not-properly-set-up-when-doing-rvm-use-2-0-0-defaul

반응형