当我输入 $PATH 时,我注意到一片丛林
-bash:/Users/patrick/.rvm/gems/ruby-1.9.3-p194@Rails/bin:/Users/patrick/.rvm/gems/ruby-1.9.3-p194@global/bin:/Users/patrick/.rvm/rubies/ruby-1.9.3-p194/bin:/Users/patrick/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/patrick/.rvm/gems/ruby- 1.9.3-p194@Rails/bin:/Users/patrick/.rvm/gems/ruby-1.9.3-p194@global/bin:/Users/patrick/.rvm/rubies/ruby-1.9.3-p194/bin:/Users/patrick/.rvm/bin:/opt/sm/bin:/opt/sm/pkg/active/bin:/opt/sm/pkg/active/sbin:/opt/sm/bin:/opt/sm/pkg/active/bin:/opt/sm/pkg/active/sbin:没有该文件或目录
我该如何清理它,因为它似乎无处不在
更新:我在 .bash_profile 中添加了此功能,因此更具可读性
function path(){
old=$IFS
IFS=:
printf "%s\n" $PATH
IFS=$old
}
- /用户/patrick/.rvm/gems/ruby-1.9.3-p194@Rails/bin
- /用户/patrick/.rvm/gems/ruby-1.9.3-p194@global/bin
- /用户/patrick/.rvm/rubies/ruby-1.9.3-p194/bin
- /用户/patrick/.rvm/bin
- /usr/bin
- /垃圾桶
- /usr/sbin
- /sbin
- 在/usr/本地/bin
- /usr/X11/bin
- /用户/patrick/.rvm/gems/ruby-1.9.3-p194@Rails/bin
- /用户/patrick/.rvm/gems/ruby-1.9.3-p194@global/bin
- /用户/patrick/.rvm/rubies/ruby-1.9.3-p194/bin
- /用户/patrick/.rvm/bin
- /opt/sm/bin
- /opt/sm/pkg/active/bin
- /opt/sm/pkg/active/sbin
- /opt/sm/bin
- /opt/sm/pkg/active/bin
- /opt/sm/pkg/active/sbin
我想由于 rvm 和 jewelrybox 我有一些重复的东西。
答案1
检查你的 .bash_profile 中是否有类似如下的行:
[[ -s "/Users/USER/.rvm/scripts/rvm" ]] && source "/Users/USER/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
并删除所有重复项,这样就可以修复您的 rvm 重复项。