将源文件添加到.bash_profile

时间:2014-09-27 04:25:50

标签: ruby rvm osx-mavericks .bash-profile

刚刚在我的Mac上安装了rvm,它给了我这条消息:

  • 警告:你有'〜/ .profile'文件,你可能想要加载它, 为此,将以下行添加到'/Users/pdenlinger/.bash_profile':

    source~ / .profile

开放.bash_profile并将其添加为:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "/usr/local/rvm/scripts/rvm" # Load RVM into a shell session *as a function* export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH" PATH="$HOME/Scala/bin/:${PATH}" export PATH CLASSPATH="$HOME/AtomicScala/code:${CLASSPATH}" export CLASSPATH export EDITOR='subl -w' export PATH=/usr/local/bin:$PATH export PATH=/usr/local/bin:$PATH export PATH="/usr/local/bin:$PATH" export PATH="/usr/local/bin:$PATH" source ~/.profile

没有编辑路径变量的经验,所以想知道我是否正确执行了此操作?如果没有,那么正确的方法是什么?

谢谢。

1 个答案:

答案 0 :(得分:0)

你做得很好,运行rvm update以查看警告是否消失:

rvm get head

顺便说一句。你可以像这样改进你的配置:

export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH"
export PATH="$HOME/Scala/bin/:${PATH}"
export CLASSPATH="$HOME/AtomicScala/code:${CLASSPATH}"
export EDITOR='subl -w'
source ~/.profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "/usr/local/rvm/scripts/rvm" # Load RVM into a shell session *as a function*