Getting “Warning! PATH is not properly set up” whe

2019-01-09 23:55发布

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

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 doing the same

$ rvm use 2.0.0 --default

now gives no error, i.e.

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

but new windows are still giving me ruby 1.9.3, not 2.0.0

My .bashrc file has in it:

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

Trying

rvm get stable

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

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

A new terminal windows with rvm list rubies shows 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

13条回答
Emotional °昔
2楼-- · 2019-01-10 00:27

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.

查看更多
Root(大扎)
3楼-- · 2019-01-10 00:28

I was stuck after I uninstalled rvm with

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.

查看更多
趁早两清
4楼-- · 2019-01-10 00:28

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
查看更多
【Aperson】
5楼-- · 2019-01-10 00:29

The answer was to put this:

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

**at the BOTTOM** (last line - important!) of my .bashrc file. I had it in my .bash_profile file (I am on Ubuntu) and that only partially worked leading to the confusing errors.

查看更多
老娘就宠你
6楼-- · 2019-01-10 00:30

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

查看更多
Luminary・发光体
7楼-- · 2019-01-10 00:35

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.

查看更多
登录 后发表回答