2016-08-19 68 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,我碰巧遇到了这些问题:) –