哦,我的 mac 里有.bashrc, 然后里面有 rvm 路径配置
(master)$ cat ~/.bashrc [ruby-2.1.1]
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
zsh bash 都会自动生成脚本或者在存在的脚本中添加环境,我用 zsh,安装完毕就在 zshrc 中添加了环境,还生产了.bashrc 和.basr_profile 两个文件
要不试试排除法,先建一个空的 ~/.zshrc 文件,然后把之前的配置一行一行的复制过来。看看到底是哪一行出的问题。 这个办法虽然麻烦了点,应该是可行的吧。
+1
# .zshrc
export PATH="$PATH:/opt/erlang/17.5.6.2/bin:/home/yy/.nvm/versions/node/v0.12.4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin"
# ~/.profile ~/.bash_profile ~/.bashrc 文件里面的rvm配置全部删除了
# Then
# yy at yy in ~ [11:49:39]
$ echo $PATH
/home/yy/.rvm/gems/ruby-2.2.3/bin:/home/yy/.rvm/gems/ruby-2.2.3@global/bin:/home/yy/.rvm/rubies/ruby-2.2.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/opt/erlang/17.5.6.2/bin:/home/yy/.nvm/versions/node/v0.12.4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/home/yy/.rvm/bin
# Note here
export PATH="$PATH:/opt/erlang/17.5.6.2/bin......
$PATH:
补充: ~/.zlogin and ~/.zshrc.pre-oh-my-zsh
# ~/.zshrc.pre-oh-my-zsh
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
# ~/.zlogin
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*