行不在我的 Mac OSX Snow Leopard 上的 .bash_profile 和 .bashrc 中执行 [英] line doesn't execute in .bash_profile and .bashrc on my Mac OSX Snow Leopard
问题描述
我刚刚安装了运行良好的 Ruby 版本管理器 (RVM),但它要求我在我的/.bash_profile 和 ~/.bashrc 文件中添加以下行:
I just installed Ruby Version Manager (RVM) which is working fine but it asked me to put the following line in my /.bash_profile and ~/.bashrc files:
if [[ -s /Users/tammam56/.rvm/scripts/rvm ]] ; then source /Users/tammam56/.rvm/scripts/rvm ; fi
看内容我看到以下内容:
looking at the content I see the following:
tammam56$ cat /.bash_profile
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"
if [[ -s /Users/tammam56/.rvm/scripts/rvm ]] ; then source /Users/tammam56/.rvm/scripts/rvm ; fi
tammam56$ cat ~/.bashrc
export PATH=/usr/local/bin:$PATH
export MANPATH=/usr/local/man:$MANPATH
if [[ -s /Users/tammam56/.rvm/scripts/rvm ]] ; then source /Users/tammam56/.rvm/scripts/rvm ; fi
但是,当我启动新的终端窗口时,它不会执行我知道的命令,因为我将默认的 Ruby 版本设置为 1.9,如果我手动执行该行,则会得到正确的版本:
However when I start new Terminal window it doesn't execute the command I know this as I set my default Ruby verion to 1.9 and if I execute the line manually I get to the correct version:
tammam56$ ruby -v
ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]
Macintosh-37:~ tammam56$ if [[ -s /Users/tammam56/.rvm/scripts/rvm ]] ; then source /Users/tammam56/.rvm/scripts/rvm ; fi
Macintosh-37:~ tammam56$ ruby -v
ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-darwin10.2.0]
有什么想法可以解决这个问题吗?
Any ideas how I can fix that?
谢谢,
谭
推荐答案
如果您有一个 ~/.profile 尝试添加以下行.
If you have a ~/.profile try adding the following line to it.
if [[ -s/Users/tammam56/.rvm/scripts/rvm ]] ;然后 source/Users/tammam56/.rvm/scripts/rvm ;菲
if [[ -s /Users/tammam56/.rvm/scripts/rvm ]] ; then source /Users/tammam56/.rvm/scripts/rvm ; fi
这篇关于行不在我的 Mac OSX Snow Leopard 上的 .bash_profile 和 .bashrc 中执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!