【发布时间】:2016-11-07 17:07:07
【问题描述】:
https://gorails.com/setup/osx/10.10-yosemite 将 Homebrew 和 Ruby 安装到 Mac OS X 10.10.5 的步骤包括在终端中运行这些行:
brew install rbenv ruby-build
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile source ~/.bash_profile
现在两行都成功运行,但是每次打开终端时都会出现此错误消息(名称替换为“x”):
-bash: /Users/x/.bash_profile: line 12: syntax error near unexpected token `then'
-bash: /Users/x/.bash_profile: line 12: `export PATH="/Users/x/anaconda/bin:$PATH"if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi'
搜索“终端打开时出现 bash 错误”的错误和变体并没有找到删除错误消息的方法。
【问题讨论】:
标签: ruby bash macos terminal homebrew