RVM和bash_profile [英] RVM and bash_profile
问题描述
我在Mac上安装RVM时遇到问题.我带上电脑维修风扇,所以我正在使用妻子来设置环境,以完成一些工作.
I'm having problems installing RVM on my mac. I took my computer in to have the fan repaired so I'm using my wives trying to set up my environment to get some work done.
我遇到的问题是bash_profile.每次添加函数时: [[-s"$ HOME/.rvm/scripts/rvm"]]&& . "$ HOME/.rvm/scripts/rvm"#加载RVM函数
The problem I'm having is the bash_profile. Every time I add the function: [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
然后重新加载外壳程序,出现以下错误:
and then reload the shell I get the following error:
-bash:导出:-s': not a valid identifier
-bash: export:
/Users/Christine/.rvm/scripts/rvm':无效的标识符
-bash:导出:`]]':不是有效的标识符
Christines-MacBook:〜Christine $
-bash: export: -s': not a valid identifier
-bash: export:
/Users/Christine/.rvm/scripts/rvm': not a valid identifier
-bash: export: `]]': not a valid identifier
Christines-MacBook:~ Christine$
这是我当前的环境:
- OSX Lion 10.7.2
- git版本1.7.5.4
- 已安装最新的RVM
- xcode版本4.2.1
- bash_profile: 导出PATH =/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/sbin:/usr/sbin [[-s"$ HOME/.rvm/scripts/rvm"]]& ;& . "$ HOME/.rvm/scripts/rvm"#加载RVM函数
- OSX Lion 10.7.2
- git version 1.7.5.4
- latest RVM is installed
- xcode version 4.2.1
- bash_profile: export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/sbin:/usr/sbin[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
谢谢.
推荐答案
您的最终要点有多准确?也就是说,您的bash_profile
会说:
How accurate is your final bullet point? That is, does your bash_profile
say:
export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/sbin:/usr/sbin[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
或
export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/sbin:/usr/sbin
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
它们应该放在单独的行上,并且根据您的错误消息,我想这就是问题所在.
They should be on separate lines, and based on your error message, I'd guess this is the problem.
这篇关于RVM和bash_profile的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!