打开终端当bash错误 [英] Bash error when opening terminal
本文介绍了打开终端当bash错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
最近,我用这个下面的命令安装了Ruby在我的Mac:
I recently installed Ruby on my mac using this following command:
brew install rbenv ruby-build
我当时指示输入这个命令添加rbenv来砸所以它加载每个终端是开放时间:
I was then instructed to enter this command to add rbenv to bash so it loads every time the terminal is open:
# Add rbenv to bash so that it loads every time you open a terminal
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
source ~/.bash_profile
现在,每次我打开终端我得到这个错误:
Now, everytime I open the terminal I get this error:
Last login: Sun Sep 6 17:30:09 on ttys000
-bash: /Users/pw/.bash_profile: line 1: syntax error near unexpected token `source'
-bash: /Users/pw/.bash_profile: line 1: `if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi source /Users/pw/.bash_profile'
任何想法我怎么能停止显示,这个错误?
Any ideas to how I can stop this error from showing?
感谢
推荐答案
有应该在底部的一行你的〜/ .bash_profile中
,上面写着:
There should be a single line at the bottom of your ~/.bash_profile
that says:
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
这就是全部。 源的东西没有提到
。
这篇关于打开终端当bash错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文