终端启动时出错

问题描述 投票:12回答:4
-bash: /etc/profile.d/rvm.sh: No such file or directory
-bash: /Users/janekambani/.bash_profile: line 1: conditional binary operator expected
-bash: /Users/janekambani/.bash_profile: line 1: syntax error near `"$HOME/.rvm/scripts/rvm"'
-bash: /Users/janekambani/.bash_profile: line 1: `[[ -s "$HOME/.rvm/scripts/rvm"]] && . "$HOME/.rvm/scripts/rvm" '

我试过这个:

sudo rm -rf /etc/rvmrc /etc/profile.d/rvm.sh /usr/local/rvm /usr/local/bin/rvm $HOME/.rvm $HOME/.rvmrc

但我仍然得到同样的错误。即时通讯使用OS X 10.8

rvm ruby-1.9.3
4个回答
17
投票

看一下/ etc / profile的来源。

在10.8 Mac OS上,使用sudo安装RVM时,在/etc/profile.d/rvm.sh上添加一行。即使您使用rvm implode删除RVM,也只能在那里停留RVM,并且会在启动任何终端时显示该错误。


8
投票

使用您喜欢的文本编辑器(nanovim等)打开/etc/profile并注释掉这两行:

source /etc/profile.d/sm.sh
source /etc/profile.d/rvm.sh

然后保存文件。


7
投票

要解决使用RVM的任何问题:

rvm get stable --auto-dotfiles #OR:
rvm get head --auto-dotfiles

它将删除现有的采购线,并添加新的工作线。


0
投票

这是由于RVM的拙劣安装(至少试图安装shell加载器的部分被破坏)。你最近尝试过install RVM吗?

有些东西一直试图插入RVM加载代码,它已经弄得一团糟。

这是我的建议:

  1. 制作.bash_profile的备份副本。
  2. 在文本编辑器中打开它并删除所有内容,但: export PATH=/Applications/SenchaSDKTools-2.0.0-Developer-Preview:$PATH export PATH=/Applications/SenchaSDKTools-2.0.0-Developer-Preview/command:$PATH export PATH=/Applications/SenchaSDKTools-2.0.0-Developer-Preview/jsbuilder:$PATH

在下面添加以下行:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

保存并打开另一个终端,看看错误是否消失。

© www.soinside.com 2019 - 2024. All rights reserved.