2015-08-14 38 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後刪除它,一切運行良好。

相關問題