加载新的Bash shell时找不到RVM

use*_*981 4 ruby rvm

我真的很困惑这个RVM Bash无法找到我的目录.这真的让我很伤心.每当我加载一个新的bash shell时,它一直告诉我:

-bash: /Users/<username>/.rvm/scripts/rvm : No such file or directory
Run Code Online (Sandbox Code Playgroud)

我无法弄清楚我的bash有什么问题.

以下是我的.bashrc样子:

1 export PATH=/usr/local/bin:/usr/local/sbin:$PATH
2 
3 
4 export PATH=/usr/local/bin:/usr/local/sbin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/opt/local/bin:/opt/local/sbin:/Users/<username>/.rvm/gems/ruby-1.9.2-p290/bin:/    Users/<username>/.rvm/gems/ruby-1.9.2-p290@global/bin:/Users/<username>/.rvm/rubies/ruby-1.9.2-p290/bin:/Users/<username>/.rvm/bin:/usr/local/bin:/usr/local/sbin:/usr/local/mysq    l/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/usr/local/MacGPG2/bin
5 
6 
7 # This line for ruby version manager has been commented out
8 PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
Run Code Online (Sandbox Code Playgroud)

以下是我的.bash_profile:

 6 [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
 7 
 8 ##
 9 # Your previous /Users/<username>/.bash_profile file was backed up as /Users/<username>/.bash_profile.macports-saved_2011-11-01_at_20:41:30
10 ##
11 
12 # MacPorts Installer addition on 2011-11-01_at_20:41:30: adding an appropriate PATH variable for use with MacPorts.
13 export PATH=/opt/local/bin:/opt/local/sbin:$PATH
14 # Finished adapting your PATH environment variable for use with MacPorts.
15 
16 
17 # Setting PATH for Python 2.7
18 # The orginal version is saved in .bash_profile.pysave
19 PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
20 export PATH
Run Code Online (Sandbox Code Playgroud)

Rem*_*ear 6

这通常发生在损坏的RVM安装中.您是否只是尝试删除RVM或意外删除〜/ .rvm?

我首先尝试删除.bash_profile中的第6行,因为现在加载RVM的官方方式似乎就是你.bashrc第8行的内容.另外,请确保实际上正在加载.bashrc.在OS X上,默认情况下未加载.bashrc.

请务必关闭所有终端窗口并重新打开它们,以便再次获取所有配置文件脚本,并且不会错过任何一个.

如果它仍然不起作用,我建议你再次安装它 curl -L https://get.rvm.io | bash -s stable

  • 乐于帮助.还有JewelryBox,如果你想要一些GUI来配合你的RVM努力.http://jewelrybox.unfiniti.com (3认同)