Getting "Warning! PATH incorrectly configured" when using rvm 2.0.0 --default

Above does not work the first time, works the 2nd time.

Try installing ruby โ€‹โ€‹version 2.0.0 for any new shell windows.

Performance

$ rvm use 2.0.0 --default 

gives

 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 

Then do the same

 $ rvm use 2.0.0 --default 

now does not give an error, i.e.

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

but new windows still give me ruby โ€‹โ€‹1.9.3 and not 2.0.0

In my .bashrc there is:

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

My .bash_profile has:

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

Attempt

 rvm get stable 

seems to work, but in the end a lot of green output shows:

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

New terminal windows with rvm list rubies show this:

 $ 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 
+100
ruby bash .bash-profile rvm
Aug 16 '13 at 15:15
source share
15 answers

The answer was as follows:

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

** in BOTTOM ** (the last line is important!) of my .bashrc file. I had this in my .bash_profile file (I'm on Ubuntu) and it only partially worked, leading to confusing errors.

+163
Aug 16 '13 at 17:11
source share

I got stuck after I removed rvm with

 rvm implode 

then after reinstalling rvm he got the same error message. By browsing the git website page. He lists the tools on his page and recommends using

 rvm reset 

after installation. This fixed my error message. No changes to PATH are required.

+157
Sep 19 '14 at 21:37
source share

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

 export PATH="$GEM_HOME/bin:$PATH" 
+24
Jul 22. '15 at 20:40
source share

I tried Michael Darrant's solution and it did not work for me. but I ran rvm get stable --auto-dotfiles and it started working as it wanted.

Hope this helps

+22
Feb 05 '14 at 15:19
source share

This is not the answer to the question asked, but to the question related to it, which was asked by most commentators / respondents - why do you need to put the rvm line at the bottom of the rc shell file?

The answer is simple.

  • Downloadable rvm code puts the rvm ruby โ€‹โ€‹binary directories on the front of $PATH and
  • .bashrc (or the default equivalent for your 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 

It is clear that if something is present in the shell initialization file after the RVM line and makes any changes to $ PATH, more specifically, if it adds directories to $PATH , then these changes will push the directories added by rvm down from their first position . RVM, upon invocation, discovers that its ruby โ€‹โ€‹binary directories are not at the very beginning of $PATH and BAM! you will get a warning :).

I hope that everything becomes clear.

+7
Aug 16 '14 at 20:20
source share

I have the following question (I want so that I can just add a comment, but I do not have enough credits). I had the same problem - and when I followed the rvm script that was suggested using --auto-dotfiles , I had problems because it somehow deleted the shell script from my .bashrc_profile file.

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

Have you accidentally discovered why this works the way it is done, and not with the line in the middle of the .bashrc file? Do you have clarity about how Unix loads an environment variable that makes RVM work in one instance and not in another?

+5
Aug 28 '13 at 10:22
source share

Just adding your own experience: if you are using .bash_profile , check if .bashrc interfering . Killing .bashrc in favor of a single Bash configuration on .bash_profile works in this case.

+5
Jul 30 '14 at 8:40
source share

I faced the same problem. I found that in the 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 

some entries for rvm. I commented on one entry and its working tone.

 #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 
+5
Apr 16 '15 at 6:23
source share

I cleared everything that had .rvm in it from my PATH = line in my .zshrc

This fixed the problem for me where the other answers here (search for rvm script, or stabilization with automatic dotfiles) did not.

+3
Mar 20 '15 at 3:20
source share

I found this command very useful. He decides my case. So if someone has the same problem, try: rvm get stable --auto-dotfiles

+2
Feb 06 '15 at 9:27
source share

rvm install ruby-head Fixed a problem for me - not enough time, but did the trick. Not sure if this made any unexpected updates to my bash files.

+1
05 Oct '15 at 1:12
source share

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

I basically saved ~/.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 confuse rvm

0
Dec 23 '17 at 14:02
source share

This worked after commenting out the top two duplicate lines and adding them at the bottom. Do not forget to restart the terminal to make it 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* 
0
Mar 16 '19 at 12:57
source share

Can add

 rvm_silence_path_mismatch_check_flag=1 

into your ~/.rvmrc . This is what a warning message offers.

0
Jul 14 '19 at 18:46
source share

I BASED THIS PROBLEM. TRY TO USE THE TEAM AS IT:

 rvm use 2.0.0-p353 

ADD -p353 or another version of the version to the end of the line

-2
Oct 21 '15 at 8:21
source share



All Articles