2015-08-14 37 views
0

希望有人可以帮我找出这个错误的原因:BASH错误,意外的标记附近的“源”

-bash: /Users/me/.bash_profile: line 1: syntax error near unexpected token `source' 
-bash: /Users/me/.bash_profile: line 1: `if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi source /Users/me/.bash_profile' 

这里是我的.bash_profile行:

if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi source /Users/me/.bash_profile 
+0

在'fi'和'source'之间尝试使用分号 –

+0

您真的在同一个文件中采用'/ Users/me/.bash_profile'吗?这将导致无限循环。 – chepner

回答

3

你错过了分号后fi

if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi; source /Users/me/.bash_profile 
1

检查你的.bash_profile

它应该是这样的

if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi 

的网络连接后应该结束。

/Users/me/.bash_profile是您应该在编辑bash配置文件后运行的命令。只需在fi后删除它,一切运行良好。

相关问题