【问题标题】:Adding source file to .bash_profile将源文件添加到 .bash_profile
【发布时间】:2014-11-22 03:45:36
【问题描述】:

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

  • 警告:您有“~/.profile”文件,您可能需要加载它, 为此,将以下行添加到“/Users/pdenlinger/.bash_profile”:

    来源 ~/.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

没有编辑路径变量的经验,所以想知道我这样做是否正确?如果没有,正确的方法是什么?

谢谢。

【问题讨论】:

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


    【解决方案1】:

    你做得很好,运行 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*
    

    【讨论】:

      猜你喜欢
      • 2020-12-04
      • 2016-08-26
      • 2012-05-02
      • 2014-08-14
      • 1970-01-01
      • 2015-10-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多