I recently installed Ruby on my mac using this following command:
brew install rbenv ruby-build
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?
Thanks