2016-08-19 73 views
0

我剛剛安裝了RVM的全新副本和運行rvm gemset list時,我不斷收到此錯誤:RVM與OhMyZSH警告與PATH設置不正確

$ rvm gemset list 
Warning! PATH is not properly set up, '/Users/dmonsewicz/.rvm/gems/ruby-2.3.1/bin' is not available, 
     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-2.3.1'. 

gemsets for ruby-2.3.1 (found in /Users/dmonsewicz/.rvm/gems/ruby-2.3.1) 
=> (default) 
    * 

這裏是我的.zshrc文件:

export HOME=/Users/dmonsewicz 

# Path to your oh-my-zsh configuration. 
ZSH=$HOME/.oh-my-zsh 

# Set name of the theme to load. 
# Look in ~/.oh-my-zsh/themes/ 
# Optionally, if you set this to "random", it'll load a random theme each 
# time that oh-my-zsh is loaded. 
ZSH_THEME="ys" 

# Example aliases 
# alias zshconfig="mate ~/.zshrc" 
# alias ohmyzsh="mate ~/.oh-my-zsh" 

# Set to this to use case-sensitive completion 
# CASE_SENSITIVE="true" 

# Uncomment this to disable bi-weekly auto-update checks 
# DISABLE_AUTO_UPDATE="true" 

# Uncomment to change how often before auto-updates occur? (in days) 
# export UPDATE_ZSH_DAYS=13 

# Uncomment following line if you want to disable colors in ls 
# DISABLE_LS_COLORS="true" 

# Uncomment following line if you want to disable autosetting terminal title. 
# DISABLE_AUTO_TITLE="true" 

# Uncomment following line if you want to disable command autocorrection 
# DISABLE_CORRECTION="true" 

# Uncomment following line if you want red dots to be displayed while waiting for completion 
# COMPLETION_WAITING_DOTS="true" 

# Uncomment following line if you want to disable marking untracked files under 
# VCS as dirty. This makes repository status check for large repositories much, 
# much faster. 
# DISABLE_UNTRACKED_FILES_DIRTY="true" 

# Uncomment following line if you want to shown in the command execution time stamp 
# in the history command output. The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"| 
# yyyy-mm-dd 
# HIST_STAMPS="mm/dd/yyyy" 

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) 
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ 
# Example format: plugins=(rails git textmate ruby lighthouse) 
plugins=(git) 

source $ZSH/oh-my-zsh.sh 

# User configuration 

export PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin" 

# # Preferred editor for local and remote sessions 
# if [[ -n $SSH_CONNECTION ]]; then 
# export EDITOR='vim' 
# else 
# export EDITOR='mvim' 
# fi 

# Compilation flags 
# export ARCHFLAGS="-arch x86_64" 

# ssh 
# export SSH_KEY_PATH="~/.ssh/dsa_id" 

PATH=$PATH:/usr/local/bin:/usr/local/sbin:$PATH 
export LOCALEMMA_EMMA_BASE_DIR=/Users/dmonsewicz/dev/emma/ 
export LOCALEMMA_EMMADMIN_BASE_DIR=/Users/dmonsewicz/dev/emmadmin/ 
export LOCALEMMA_AUDIENCE_BASE_DIR=/Users/dmonsewicz/dev/audience/ 
export WORKON_HOME=$HOME/.virtualenvs 

export PERL5LIB=$HOME/perl5/lib/perl5; 
PATH=$HOME/perl5/bin:$PATH 

PERL_MB_OPT="--install_base \"/Users/dmonsewicz/perl5\""; export PERL_MB_OPT; 
PERL_MM_OPT="INSTALL_BASE=/Users/dmonsewicz/perl5"; export PERL_MM_OPT; 

ORIGINAL_PATH=$PATH 

function build_path { 
    PATH=$(node bin):$ORIGINAL_PATH 
} 

PROMPT_COMMAND=build_path 

export NVM_DIR="/Users/dmonsewicz/.nvm" 
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm 

# LOCALEMMA lemma zsh completion 
fpath=(/Users/dmonsewicz/dev/LocalEmma/bin $fpath) 
autoload -U compinit 
compinit 

eval $(dinghy shellinit) 
export RAILS_ENV="development" 
export DB_NAME="traverse_core_development" 
export DB_USER="dmonsewicz" 
export DB_PASSWORD="" 

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

export PATH 

source /usr/local/bin/virtualenvwrapper.sh 

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" 
+0

當你'回聲$ PATH'在當前shell會發生什麼? – Anthony

+0

@Anthony'$回聲$ PATH /用戶/ dmonsewicz/perl5的/ bin中:在/ usr/bin中:/ bin中:/ usr/sbin目錄:/ sbin目錄:在/ usr/local/bin目錄:在/ usr/local/bin目錄:在/ usr/local/sbin:/ usr/bin:/ bin:/ usr/sbin:/ sbin:/ usr/local/bin:/ Users/dmonsewicz/.rvm/bin – dennismonsewicz

回答

-1

使用您的終端作爲登錄外殼(如果您使用的是zsh /usr/bin/zsh --login)並嘗試將以下行添加到您的~/.zshrc文件中並將其來源source ~/.zshrc

export PATH="$PATH:$HOME/.rvm/bin" 
source ~/.rvm/scripts/rvm 

然後使用RVM命令等rvm use 2.3.0。登錄shell讓您的RVM腳本來改變你的系統配置文件..喜歡追加RVM紅寶石路到您的$PATH可變

+0

等價線已經存在。 –

+0

在運行rvm命令之前運行'/ usr/bin/zsh --login' @ D-side – sa77

+0

不,錯誤信息會不同。實際上,我不是OP,我碰巧遇到了這些問題:) –