0

I'm having an issue with my bash profile on my mac. Given the following from my .bash_profile

FOO="$(brew --prefix coreutils)/libexec/gnubin"
BAR="$(brew --prefix ruby)/bin"
BAZ="$(brew --prefix python)/bin"

The first line successfully completes, but the two following lines print the following error when I start terminal

-bash: brew: command not found

When I run brew --prefix ruby or brew --prefix python at the command line after terminal starts, it prints out their respective paths.

Can anybody figure this out?

  • Are they the exact commands you have and no others? It looks like you edited it especially as the bins suggest you are changing your PATH and it is those lines we need to see? To debug put a echo $PATH before each line – Mark Aug 23 '16 at 11:13
  • The lines starting with BAR and BAZ in your .bash_profile file are probably poorly formatted. Check this with a decent text editor (e.g TextWrangler) – klanomath Aug 23 '16 at 11:38
1

The brew command is in /usr/local/bin, so you need to ensure that you either use the full path to brew in your commands, i.e. /usr/local/bin/brew or you need to set your PATH environment variable in your profile before using brew, e.g.:

export PATH=/usr/local/bin:$PATH
  • As this is part of the standard default I would suggest this is a comment asking for more details – Mark Aug 23 '16 at 11:12
  • @Mark Sorry - what is part of the standard default of what? How can this be a comment - it is clearly an answer offering the OP 2 possible solutions. And why would I ask for more details - I can clearly see what the problem is and what the answer is. – Mark Setchell Aug 23 '16 at 11:17
  • In that case why does the first line work? – Mark Aug 23 '16 at 11:21
  • @Mark Let's continue this discussion when the OP tells us whether my "comment" solves his problem, and you answer my question above. – Mark Setchell Aug 23 '16 at 11:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .