Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple commands not found in Terminal after homebrew install attempt -- reset PATH? [duplicate]

This started when I was trying to install homebrew. I'm very new to all of this so I apologize in advance if I do not explain this with the correct vocabulary.

I initially ran brew doctor and got command not found. After scouring some forums and changing $PATH, I at least got to the point where brew doctor gave me a warning suggesting I remove part of $PATH. Unfortunately I can't remember exactly which part--something starting with "/opt."

I removed some of the $PATH but am now unable to run basic commands such as:

Tays-MacBook-Pro:~ taytufenkjian$ irb
-bash: irb: command not found
Tays-MacBook-Pro:~ taytufenkjian$ open ~/.bash_profile
-bash: open: command not found

Now my brew doctor attempts look like this:

Tays-MacBook-Pro:~ taytufenkjian$ brew doctor
/usr/local/bin/brew: line 2: dirname: command not found
/usr/local/bin/brew: line 5: basename: command not found
/usr/local/bin/brew: line 8: readlink: command not found
/usr/local/bin/brew: line 16: cd: /Users/taytufenkjian/../Library: No such file or directory
/usr/local/bin/brew: line 18: uname: command not found
/usr/local/bin/brew: line 18: tr: command not found
/usr/local/bin/brew: line 23: exec: ruby: not found

I thought I'd try to reset my $PATH but the commands I keep trying give me the "command not found" message.

$PATH details:

Tays-MacBook-Pro:~ taytufenkjian$ echo $PATH
/usr/local/bin:/usr/local/bin:/usr/local/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/bin:/usr/local/bin:/Users/taytufenkjian/

I've been at this for a couple of hours and I'm so confused. I'm trying to set up my environment for a class that starts in a few days.

like image 989
TayTuf Avatar asked Oct 17 '13 00:10

TayTuf


2 Answers

I was actually able to get some outside help on this.

For other newbies reading this, I created a new .bash_profile and saved over the existing one.

I added this line to the .bash_profile: export PATH=/usr/local/bin:$PATH

So editing .bashrc didn't work but creating a new .bash_profile and editing that did work.

like image 109
TayTuf Avatar answered Oct 10 '22 03:10

TayTuf


It is happens when you just copy the line (below) into the .bash_profile without removing the quotes ('xxxx')

export PATH='/usr/local/bin:$PATH'

To resolve, just run in console:

export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin

Then, edit again the file removing the quotes:

vim ~/.bash_profile

like image 29
Tiago Beviláqua Avatar answered Oct 10 '22 03:10

Tiago Beviláqua