每当我 cd 或使用 rvm 命令时都会显示:
-bash: /usr/local/rvm/scripts/initialize: line 80: syntax error near unexpected token `fi'
-bash: /usr/local/rvm/scripts/initialize: line 80: ` fi'
-bash: /usr/local/rvm/scripts/hook: line 32: syntax error near unexpected token `fi'
-bash: /usr/local/rvm/scripts/hook: line 32: `fi'
这是随机发生的。有什么想法吗?
这是我的路径:
/usr/local/rvm/gems/ruby-1.9.3-p194/bin
/usr/local/rvm/gems/ruby-1.9.3-p194@global/bin
/usr/local/rvm/rubies/ruby-1.9.3-p194/bin
/usr/local/rvm/bin
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin
/usr/X11/bin
/opt/sm/bin
/opt/sm/pkg/active/bin
/opt/sm/pkg/active/sbin
更新:我更新至 OS X 10.8 后,问题自行解决
答案1
我现在只能猜测,但这会在受限的 shell 中发生,例如bash
通过链接执行时sh
,或者使用运行时bash -r
。确保您使用类似的登录 shell bash -l
,在中验证您的 shell /etc/passwd
。
答案2
只需重新安装 rvm - 即可解决我的问题
\curl -sSL https://get.rvm.io | bash -s stable